First, I believe, we must agree with Scripture that every soul ever born will either reject the gospel of Jesus Christ or accept the gospel of Jesus Christ, and therefore spend eternity in Heaven or Hell. Second, we must also acknowledge that God is love, is holy, is just, and perfect; therefore, we cannot blame Him if a soul (whether mentally ill or not) spends eternity in hell for rejecting Him. Thirdly, we must accept the truth that the soul that spends eternity in hell are themselves responsible for their rejection of the gospel of Jesus Christ, and not their friends, family, or the devil though all three may have played a part in the soul not putting faith in Christ.
This is what makes sin and the devil so terrible, because they confound the lost, confuse the saved, and easily manipulate us into obeying them over obeying God and His Word. Usually, simply because we choose to follow them (the flesh, the world, and the devil) instead of heeding to godly wisdom and the Spirit of God, we sow to the flesh destruction and ultimately the loss of rewards for the saved and eternal condemnation for the lost. So, though they may lead us astray and blind us to the truth, we are responsible for choosing (or allowing ourselves) to follow them instead of being as Joshua, “And if it seem evil unto you to serve the LORD, choose you this day whom ye will serve; whether the gods which your fathers served that were on the other side of the flood, or the gods of the Amorites, in whose land ye dwell: but as for me and my house, we will serve the LORD.”
Though we must remember  we cannot serve God, even if we want to, without the Spirit working in us to do so, and  without giving ourselves over to the reading, studying, mediating on the Word of God and having a faithful prayer life. We do not save and convert souls, nor can we convince a soul they are lost and need Christ. It is the Father, Son, and Spirit that move in us to present the gospel and in the soul to accept the gospel. Remember Paul said, “I have planted, Apollos watered; but God gave the increase. So then neither is he that planteth any thing, neither he that watereth; but God that giveth the increase.”
With the mentally handicapped we have a great variety, and here is just three groups I can think of, and a little as to what I believe concerning salvation:
1. Born mentally handicapped – People that are born mental can have degrees of handicap, where some comprehend more than others. This would include those born to drug addicts or simply gene and birth defects. I totally believe that God can and does communicate with them, for we must remember God is all powerful, and what is it but a simple thing for the Creator to speak to His creation. Remember when Moses was crying about his speaking? God said, “Who hath made man's mouth? or who maketh the dumb, or deaf, or the seeing, or the blind? have not I the LORD?” So, to say God could not communicate to them so they freely get to go to Heaven would mean  God isn’t all powerful, and  they do not need the Savior Jesus Christ. But we know they are still sinners for Scripture declares, “all have sinned” and if we deny we sin we are a liar. Here lies the issue, we would like to assume that they could all go to Heaven because we feel sorry for them, but if we believe God can communicate with them on their level (whatever that may be) then we must also realize that they have the option to either accept or reject the truth presented by the Holy Spirit on their level.
And speaking of levels or types of mental illness, if John the Baptist can be filled with the Holy Spirit before ever leaving the womb (without a developed mind to comprehend the written Word of God), I believe the Spirit of God is not hindered at all by the mental issues of any soul.
2. Become mentally handicapped – To me this group is somewhat different because (though could have at different ages in life) they had an opportunity to hear the gospel and mentally understand it before they became mentally ill by drug use, accidents, genes, etc. I mean, if I were presented the gospel of Jesus Christ today and reject it, get in a wreck tomorrow and become mentally disabled, is God really under any obligation to guarantee me the opportunity of the Spirit of God to speak to me again in my mentally ill state? I would pray that He would, and I believe by our prayers and witnessing God will offer his salvation to these souls yet again as long as they are yet alive. Yet again, they were responsible for rejecting the truth when they could understand and hear it, and may even been at fault for the reason that they can no longer hear or understand it. And many times these things cause people to go one of two ways:  turn to trust in God,  rebel and hate God.
3. Demon possessed handicapped – I don’t want to discuss too much concerning this, but the Scripture is clear this does occur. I honestly believe many or some of the souls kept in mental institutions are demon possessed. I believe we fail to acknowledge it because they are not on the streets like during biblical times, because we have them locked away out of society and out of our minds. Also, I believe that we use so much medication in today’s society, whereby many of the possessed souls merely stay in a hypnotic, drugged induced state. You know what the problem with this is? Yes, they may hurt themselves or others if they were to be taken off of the drugs, but while on the drugs who can witness to them? Again, I believe the Holy Spirit can, but not all possessed souls get freed from oppression – but remember God is still not at fault for their rejection of his gospel, for God knows the entirety of every soul’s life and their opportunities whereby they were presented the gospel whereas we do not.
Now, please consider the above as merely my understanding from my walk through Scripture, and I am far from being a theologian. Trust God, trust the Book, and pray for both the lost souls to come to Christ and the saved souls to be about the Christian walk. We must acknowledge that ALL souls MUST go through CHRIST, for He is the way, the truth, and the life; therefore, if this be the case, and it is, this includes the mentally handicapped soul as well as the genius.