Per Scripture, the only way to heaven is by putting our trust in Christ and accepting His free gift of salvation.
The question you pose is based on a common misunderstanding of the relationship between how "good" we are and whether or not we are "good enough" to get to Heaven. The problem is that not one of us has ever kept the Ten Commandments, much less the hundreds of other laws in the Bible, and therefore not one of us is "good enough" to get to Heaven on our own merits.
There's a much more complete explanation of this here.
A longer version of the same answer would go like this:
First, everyone on earth has sinned, save Jesus.
Romans 3:23 (KJV)
For all have sinned, and come short of the glory of God;
When you examine it, every one of us has broken each and every one of the Ten Commandments, if not in deed, then in heart and in intent. For example, perhaps we've never committed adultery physically, but as Jesus said, if we've looked at someone with lust, we've committed adultery in our hearts.
Matthew 5:28 (KJV)
But I say unto you, That whosoever looketh on a woman to lust after her hath committed adultery with her already in
We've all broken the other Commandments in spirit as well, but even if one of us has squeaked away with not committing all of them, it doesn't matter. The Bible tells us that if we've broken even one, we're guilty.
James 2:10 (KJV)
For whosoever shall keep the whole law, and yet offend in one point,
he is guilty of all.
So, the none of these people are sinless by the standards laid forth in Scripture.
Romans 1 touches on the subject of whether or not we are held guilty if we've never heard the Gospel message. It lays out a few truths:
- God reveals Himself to us, and we are without excuse.
- Our ancestors had access to the truth of God, and chose to turn from them.
Romans 1:18. (KJV) For the wrath of God is revealed from heaven against all ungodliness and unrighteousness of men, who hold the truth in
19. Because that which may be known of God is manifest in them; for God hath shewed it unto them.
20. For the invisible things of him from the creation of the world are clearly seen, being understood by the things that are made, even
his eternal power and Godhead; so that they are without excuse:
21. Because that, when they knew God, they glorified him not as God, neither were thankful; but became vain in their imaginations, and
their foolish heart was darkened.
22. Professing themselves to be wise, they became fools,
23. And changed the glory of the uncorruptible God into an image made like to corruptible man, and to birds, and fourfooted beasts, and
Their unbelief and rebellion against God meant that their children, their children's children, and so on were not taught about God. It's not His fault, it's theirs. Because they chose to rebel when they knew the truth, and didn't teach their children, they doomed their children to not knowing the truth of God. This is one reason that Proverbs 22:6 is important. (Again, KJV)
Train up a child in the way he should go: and when he is old, he will
not depart from it.
In Romans 2 (KJV), we read:
11. For there is no respect of persons with God.
12. For as many as have sinned without law shall also perish without law: and as many as have sinned in the law shall be judged by
13. (For not the hearers of the law are just before God, but the doers of the law shall be justified.
14. For when the Gentiles, which have not the law, do by nature the things contained in the law, these, having not the law, are a law
15. Which shew the work of the law written in their hearts, their conscience also bearing witness, and their thoughts the mean while
accusing or else excusing one another;)
These theoretical people you mentioned are guilty. Scripture here tells us that "he shall perish without law". They will perish because they have sinned, and ignored the conscience that God has placed in each and every one of us.
Finally, it should be noted that even in civil, earthly law, ignorance of the law is not an excuse for breaking the law.
If I were to carry a concealed weapon in a state that doesn't allow concealed carry, for example, and I was arrested, would I be able to avoid the consequences by telling the Judge "I didn't know"? No. I'd be punished according to the law, whether I intentionally broke the law or not.
As we saw in Romans 2 (quoted above), the Bible tells us that God will not accept ignorance as an excuse. They will perish without the Law, as God's word states, because they have sinned and broken the law, not because they have rejected Jesus. Accepting Jesus is the only way to be saved. He pays the penalty for our guilt. However, the reason we are guilty is not because we didn't accept Him, it's because we chose to sin.
We can try to blame God all we want, and we can even try to blame the ancestors, but the simple fact remains that these people will be condemned because of their own sin.