Well, he's not the only one living on a moving vehicle. Tons of homeless people get bus passes and ride around all day and night. A train ride is less bumpy, sure, but it's effectively the same. Although what probably happens is that this kid goes on weekend train trips and comes back home the next day, unless he's seriously mentally ill. Even the most dedicated backpacker would give up on this after a week. It's basically torture.
If I understood the situation correctly, he times his day train to book a night train with a sleeping berth. Still, I agree. I would find this very uncomfortable after some time.
Hopefully he also has friends he can stay with in various cities.