This is a very poignant question and quite intriguing I must add. Indeed, how do we deal with the idea of a perfectly Just God, when considering such an unjust situation like the one in the question.
The first answer to that would be to understand the limitation of our conclusion in the hypothetical situation in the question. What I mean is, if we're tasked to prove the authenticity of the fact that the person didn't truly have the opportunity to hear the Gospel and make up their mind about Jesus, we would fail woefully, as we truly don't have all the information. Particularly in today's world of social media, the chances that someone won't hear the Gospel before they die is quite improbable.
Secondly, and most importantly, we're failing to realise the commitment of God to ensuring that the Gospel is heard by the unsaved. Let me give you just 2 examples from scripture.
The first one is in 2 Kings 5 from verse 1. It's the story of a heathen Syrian captain called Naaman. He had gone out for war and had captured an Israelite girl and brought her back as a maid for his wife. To cut the long story short, that same girl became an evangelist of sorts and witnessed about the God of Israel to Naaman when she found out about his leprosy. From her witness, not only did Naaman get healed, but he actually believed in the God of Israel as is recorded in the text.
Another example would be Philip and the Ethiopian eunuch in Acts 8:26-39. The Holy Ghost gave Philip a seemingly ridiculous instruction by asking him to leave the city of Samaria and go towards a desert region! From the story, we see that God simply wanted to get the Gospel to the Ethiopian eunuch who was reading the book of Isaiah 53. Philip explained the verse to him and got him saved and baptised, then disappeared from his presence!!! There are other examples in scriptures, but these two will suffice to prove to you that God is committed to ensuring that no one dies without hearing the Gospel. As per whether asking the question is a "sin", I don't think it is. I believe it just shows that you have a heart of compassion and burden for the lost, and don't want anyone to die without hearing the Gospel. While you may not have Philip's experience, you can in your region or community decide that as long as you're there, nobody will escape hearing the Gospel of the Lord Jesus.
Thanks for reading my lengthy response.