When orphan children are not adopted by age 18, their religion and caste are typically determined by the orphanage caring for them. If the child's parents are unknown, the orphanage assigns a religion. While children don't inherently have a caste, the orphanage's directorate or caretakers may assign one for administrative purposes, sometimes defaulting to the caretakers' caste. The specific circumstances and the orphanage's policies dictate these assignments.