Well... I guess there isn't much for them to do around there
I mean at what point do you say to yourself "I am bored... Hey.. A train! Let's go jump on the side of it and hang off while it runs down the track for fun!"
I would guess the same impulse that makes people go skydiving, para-sailing, x-games, surfing... etc ADRENALIN + being young and thus fearless. But that's just my reckoning.
But also remember this is india... you may not be aware but its normal for people to ride on the tops of trains hang on the sides etc... do a youtube search you will be amazed.. and then check out the buss.. !!!