Yes, there are many such “what if” , hypothetical, scenarios: “what if” a man believes and repents on his deathbed but can’t be baptized? Willl he be saved? “What if” a man is on his way to be baptized and a tree falls on him and kills him, will he go to hell? Your made up story is “what if” a prisoner believes but dies in prison. Same hypothetical story, just different settings. Thankfully, I don’t have to decide whether such people will be saved or lost.
Jesus answers that question for us for all time.
John 21:21-23. There was a r humor that Jesus was going to let John live and not die. Peter asked Jesus, “What about this man?” The same question you are asking me—“what about this man (in prison).” What does Jesus say? “ IF I WILL THAT HE LIVES UNTIL I COME, WHAT IS THAT TO YOU? Jesus is saying, “that’s not any of YOUR business; that’s “My” business. Jesus is saying, you don’t have to worry about it. I will take care of John. Notice He did not say what would happen to John; He just said, that’s my business and I’ll take care of it. So that is my answer to you about your imaginary prisoner. That’s not my business and neither is it yours. I can’t say the man will be lost and you can’t say the man will be saved. We’ll just have to let Jesus decide. After all, that’s HIS business.
But I can go to the Bible and see if God’s word has anything to say that might give us a clue. I can read about a DEVOUT man in Acts. I know he was a devout man because the Holy Spirit calls him that. The Spirit also describes him as being God -fearing—a BELIEVER. He says this man prayed to God ALWAYS and generously gave money to the needy. Most people would say this man was saved. But he was Not. God sent Peter to him to tell him what he MUST DO! Acts 10:2, 6. In spite of his goodness there were still things he had to do. Thankfully, Peter preached to him and he was baptized.
Another man in the Bible was Devoutly religious, a member of a very strict sect of the Jews. He said of himself, “I thought I should do many things contrary to the name of Jesus of Nazareth.” Was he sincere? Yes. He was completely sincere; but he was sincerely WRONG! Acts 26:9. Paul was not saved because he was sincere, and Cornelius was not saved just because he was a good man. Jesus told Paul ( Saul) on the road to Damascus to “go into the city and there you will be told what you MUST DO! There were things Saul had to do, no matter how sincere he was.
Now if you want to take a chance with your soul and base your salvation on what you “THINK” the Lord will do or what “YOU THINK” He ought to do, then that’s your choice. Good luck with that.
Jesus said one more thing to Peter back in John 21. After telling Peter to mind his own business, Jesus said “ YOU follow ME. That’s what I would suggest, also. You and I Know what the scriptures say TO DO. We are not on our deathbed and we are not in prison. We are without excuse because we know and we have the opportunity to do something about it. Jesus might say to us, you know what I’ve said. Now obey me.