What happened was horrible.
Some possible thoughts: Perhaps if this had not happened, the girl would have grown up to sin mortally, and deprive herself of heaven.
Perhaps she would have gone on to suffer even worse pain --the loss of her own child, maybe.
One final thought: Even children, sweet innocent children, do not ‘deserve’ heaven. No, they really don’t. None of us deserve heaven. Even after we are cleansed of original sin, and assuming we die immediately after that baptism in a state of grace, we don’t ‘deserve’ heaven, we are merely at that instant of temporal time, ‘fit’ for it. At any other time we are in some way tainted with venial and/or mortal sin, and if those are forgiven, we go on to commit more. In a lifetime of ‘70 years’ or so, imagine how many sins even an ‘average good’ person can and does commit. How does such a being ‘deserve’ heaven?" We don’t. God’s grace grants us the free gift to choose.
Maybe that grace gave that child, at the best or even the only moment of her life, the opportunity for accepting salvation. We don’t know.
But however ‘good’ we think we ourselves are, God is infinitely greater. Trying to limit Him to what we think, right now, is ‘good’, is utterly wrong. For heaven’s sake, look how many ‘good Catholics’ today think that abortion can be ‘good’ in some circumstances!!! Or that adultery might, in some cases, be ‘good’, if the first marriage didn’t ‘work’. . .etc etc. Our ideas of ‘good’ aren’t exactly perfect.