If confirmed berths are available, purchase a ticket for him. Request your nearby co-passenger to swap berth with your kid.
If status is running in WL, purchase a counter WL'ed ticket. Even if it doesnt confirm, adjust your child with yourself. When the TTE comes, explain him the matter. He should not object.
PS:- If you are traveling by Sleeper Class, kindly make sure your child has a valid photo id proof in original (Would be needed in case of confirmed ticket).