I’m sure God sees a soul as a soul, not as an infant or an elder. A soul is a soul is a soul.
Now God being omnipresent and omnipotent would know if that soul would have accepted Christ and wanted baptism to begin with. I suspect that if a child would have been a sinful person or a loving christian during his life had he lived God would know this too.
Given that baptism gives graces, that “sinful” person may have gotten the boost needed to nudge him toward Jesus. But we are humans, we don’t know what God knows, are we willing to wait and take a chance on a child who would have been sinful but due to the graces of baptism, been turned around had he lived?
We don’t know which infant we could have helped"save" through baptism and which we could not. Do you think we as parents of these children will have to answer to our lack of giving this gift of baptism to those who God entrusted in our care?