Scripture implicitly affirms the concept that we call the age of accountability (Deuteronomy 1:39; Isaiah 7:15-16). This is relative due to the fact that everybody develops differently. Thus, there exists a period of time in childhood in which God in His mercy does not count sins against a person due to lacking reason and understanding. While babies are born with a sin nature, they still cannot actually commit acts of evil.
The God of the Bible is one of love, mercy, righteousness, and truth. He would not condemn to hell somebody who never even had a chance to live. We must also keep in mind those who have severe cognitive disabilities. Though it is a teaching of Scripture that God has inscribed a moral law into the hearts of men, every person needs to have the mental capacity to act. Each man will be judged according to his own conduct (2 Corinthians 5:10; 1 Peter 1:17). Babies cannot do anything on their own. What could God judge them for?