I think this questions God's fairness. If God is a perfect judge, wouldn't he judge people fairly? Would someone who has never heard of Jesus be responsible for responding to a message they haven't heard? If that is unfair, then God wouldn't do it.
So what about people who haven't heard? I would assume that God would judge fairly. If there were a verdict that wasn't fair, God wouldn't render it. If God judges someone and renders a verdict that eternally separates that someone from him, then it would only be because it was the deserved verdict.
This may not fully satisfy the question though - we're not privy to God's knowledge and so do have the required information to know how to judge "someone who hasn't heard." We can take comfort in knowing that God is Just and wouldn't judge someone unfairly. So if someone thinks that someone else is "going to hell" and it's believed that's an unfair assessment of their eternal destiny, then we can know that God wouldn't do it.
What I think we can know is that, if any of us are to be judged on our own merit, then we're in trouble. If we're to believe Paul, then:
Rom
3:10....“
There is no one righteous, not even one,....3:23 for all have sinned and fall short of the glory of God.
But people aren't unrighteous because they haven't heard and people don't fall short because they haven't heard a message. No, we would be unrighteous and fall short because of who we are and what we do. Hearing the message leads to salvation, but not-hearing doesn't cause damnation.