A judge ruled that a man caring for his teenage brother is also now legally the boy’s father.