The question: "How on earth does one figure out the religion of infants dumped on the road, and sent to various orphanages?" is not easy to answer.
May be a literary device could be helpful. :"How on earth does one figure out the CITIZENSHIP of infants dumped on the road, and sent to various orphanages?". Instead of CITIZENSHIP we could use MOTHER TONGUE or other words as well. The absurdity of the question then stands out and points to various kinds of answers. One can infer that the relationship to parent defines these attributes. These are acquired attributes and not innate in anybody.
Religion of a person therefore is mere accident of birth and to read too much into it is meaningless. Whatever meaning that exists in a religion has been infused into it by thoughts, emotions and practice. This inference not only provides scope to change your religion, also change your religion itself. The latter stance is better and drives emancipation effort.