The ruling of Ahlul-Fatrah (the People who lived during a time in which no Prophet came) is applied to the Children of the Disbelievers
Question :
All of us know the destination of the polytheists in the Hereafter, but what will be the destination of their small children if they died without ever reaching maturity?
Answer:
If the children of the disbelievers die without having reached the age of discernment, and their parents were disbelievers, then their ruling is the ruling of the disbelievers in this life. This means that they are not washed or shrouded or prayed over or buried with the Muslims. This is because they are considered disbelievers due to their parents. This is in reference to this life. However, in reference to the Hereafter, Allâh knows best what they were doing, i.e., what they would have done had they reached adulthood. The most correct statement regarding them is that Allâh, Glorified is Him and the Most High will test them on the Day of Judgement with what He wills of some task. If they carry it out, Allâh will admit them into Paradise, and if they refuse, He will admit them into the Fire. This is what we say concerning the people of Al-Fatrah (those to whom no Prophet came in the times before Muhammad) and those whom Allâh's Divine Messages did not reach. Thus, Allâh knows best about what they used to do and they will be tested and burdened with a task according to what Allâh wills and what His Wisdom dictates. If they obey, they will enter Paradise; and if they disobey, they will enter the Fire.
Source:
Ash-Shaykh Ibn 'Uthaimin
Fatawa Islamiyah, Vol. 3 Page 145