He does neither! It is almost like he is deliberately being a jerk to everybody. First he delays, frustrating the sisters - and then he goes, mystifying the disciples so badly that poor Thomas says, maybe in resignation, "Let us also go, that we may die with him" (v. 16). Granted that Jesus could not say yes to both parties, couldn't he at least say yes to somebody?
When he gets to Bethany, it's too late. Lazarus has been dead four days. Martha gives Jesus a thinly-veiled rebuke: "Lord, if you had been here, my brother would not have died" (v. 21). A few minutes later Mary comes out and says the exact same thing (v. 32). It is significant that Lazarus is four days dead. Jesus had done a couple resurrections before - the son of the widow of Nain (Luke 7:11-15) and Jairus' daughter (Mark 5:35-42) - but those two were freshly dead. They had not even been buried yet. Jairus' daughter may only have been in a deep coma, depending on how you interpret Jesus' words, "The child is not dead but sleeping" (Mark 5:39). But Lazarus is utterly, verifiably, stinking dead. When Jesus wants the stone cover on his tomb taken off, Martha warns him not to do that because the stench of Lazarus' rotting flesh will be really bad (John 11:39).
So it's too late for Lazarus, and Jesus has made a pointless trip endangering both himself and his disciples. I imagine some of them staring at their sandals and wondering, "How much longer do I follow this guy? He seems to have lost his touch."
Only then, when everybody is sad, ticked-off and frustrated, does Jesus demonstrate that he knows what he has been doing all along. He resurrects Lazarus and restores him to his sisters. He shows that he has power over death, because Lazarus' case is definitely a resurrection (dead four days!) and not, as some might suspect in previous cases, a mere resuscitation. Jesus' bewildering delay turns out to be a deliberate act of mercy to set the faith of his followers on firmer ground. He said no that he might say a greater yes.
Many years ago an administrator with Wycliffe Bible Translators asked a group of us trainees to consider what kinds of circumstances on the mission field might test our faith. I responded that I did not understand the question. I think I quoted a couple lines of the Apostles' Creed, "I believe in God the Father Almighty, maker of heaven and earth, and in Jesus Christ, his only begotten Son, our Lord," and said, perhaps naively (but sincerely), that I could not imagine any circumstances that would upend that faith.
He answered, "Maybe your faith in God won't be tested, but what might be tested is your faith that he knows what he's doing." That answer made sense to me. Christians who are in dark and bewildering circumstances and who aren't getting their prayers answered won't necessarily convert to atheism, but they might get discouraged. They might worry or despair to such a degree that it might not seem to them like God is paying much attention, or that he has their best interests at heart, or that in all things he is working for the good of those who love him and are called according to his purpose.
I know a Christian manual laborer whose knee began bothering him some months ago. He prayed for healing, went to an orthopedist, got an x-ray and MRI and treatment - and the knee is still bad. Now the other knee is going too. He said, "I used to think I'd look back on the summer of 2013 as the time when my knee hurt. Now I think I'll look back on 2013 as the year that both my knees started hurting!" In terms of the "God-is-messing with-you" theme, his thought might be expressed, "Lord, I just asked you to heal the right knee. I didn't ask you to afflict the left one too!"
What I'd say to him is the same thing I say to all Christians who face the minor irritation (or crippling sorrow) of unanswered prayers. Be patient. Trust God. He knows what he is doing. Some day, whether in this life or the next, you will know by sight what you now must take by faith. In the meantime, all you have to worry about is obedience. If you submit to what you know to be the will of God, then you can rejoice when he says yes to your prayers, and you can rejoice even more when he says no, because that can only mean that what he has in store for you is better than what you thought you wanted.