This is an interesting question that I'm not sure we can answer definitively based on the text alone.
There are a series of points that can be definitely arrived at from the text
- The disciples all thought that Jesus meant that Lazarus was asleep,
and then Jesus explicitly stated that Lazarus is dead (John 11:14)
- Jesus planned as he had from the beginning to go back to Jerusalem to raise Lazarus from the dead so that others might see His power over life and death and in so doing they would believe in Him.
- When Jesus said "let us go unto him" (ἀλλὰ ἄγωμεν πρὸς αὐτόν), we can be certain of one thing--Jesus was certain that He would not be killed at that time. That by "going to him" Jesus did not believe that He was going to join Lazarus in death.
- Thomas believed that by going with Jesus they would also die. That we can be certain of from the text itself.
The question you have asked hinges on the antecedent of the phrase "ἵνα ἀποθάνωμεν μετʼ αὐτοῦ." There are two options: (1) that Jesus is the "him" that Thomas was referring to, meaning that Thomas thought Jesus would die; or (2) that the "him" is referring to Lazarus as your question proposes.
I tend to favor the first one for these reasons:
- In the first half of the statement you have the phrase Ἄγωμεν καὶ ἡμεῖς which typically gets translated as "let us go also" or "let us also go." Yet if you look at the verb Ἄγωμεν it carries more of the idea of being lead along. In fact it is the same verb that was used to describe the arrest of Jesus in Mark 13:11 and Luke 22:54. Therefore it could be translated as 'Let us also be led away." When you take this into account it forcefully argues that Thomas is stating that they will be joining Jesus and not Lazarus.
- More on the verb Ἄγωμεν. The use of a term that is used to describe someone being led away and arrested. Perhaps Thomas meant it this way: (1) Let us also be led away and arrested with Jesus, and (2) let us join Jesus in death. When I have preached this passage I have used this as the exegesis of this statement. A personal friend of mine has argued that prior to the resurrection that Thomas was even lost, in part based on this statement.
- Jesus himself has emphasized His going and so I think this also from the context indicates that Thomas was emphasizing the joining Jesus and not joining Lazarus.
I have always thought that what was going through the mind of Thomas at that moment was "you want us to go where? To Jerusalem, if we go there then we will be arrested and we will die. It is also interesting that Thomas did not direct the statement to Jesus, only speaking to the other disciples. His unbelief would have been apparent if He had spoken to Jesus so he only spoke to the other disciples. It highlights what is so common among men, we will express our unbelief to one another but we do not express it towards God Himself. That is why I have always admired the man in Mark 9:24, He was speaking to God, when He told Jesus "I believe, help my unbelief."