I do not agree with the statement you made that all children and the mentally impaired will be raptured with true believers. I believe that there are some children who will be left, except those who are under a certain age of accountability. I think of Esau and how God knew he would never accept Messiah. As to the mentally impaired, I really think that God looks at the heart and knows if that person were to hear the gospel would he chose God or not? My niece just died from cancer, and she was mentally impaired, and was basically 9 years old. I honestly don’t know if she is in heaven or not. I want to believe that, but I know the decision is God’s.
Yes, the decision to accept your niece into Heaven was God’s and you should be grateful for that, because He’s on record as not wanting any to perish (2 Peter 3:9). He looks for ways to save people, not for ways to exclude them, and within the boundaries of His own laws, will always default to mercy.
God does know in advance if a child will grow up to believe in Him or not. But He also knows whether they will ever be capable of making such a decision, and being absolutely just, He could never condemn someone who lacks the ability to do so. He does not deal in the hypothetical, and will not preempt our freedom of choice. For example, He knew in advance the Amorites would never repent, yet He still gave them 400 years to do so. (Gen. 15:12-16) And though He knew Esau’s heart, He did nothing until Esau rejected Him by rejecting his birthright (Genesis 25:29-34).