Playing crazy on a train... Not smart at any age.
Playing crazy games with trains can be plenty of fun. When you're a child - and the trains are made of toys. When the trains are real locomotor-driven metal vehicles, it's time to behave yourself - in other words, all hands in the carriage and absolutely no touching the controls. Whether you're 1 or 100, playing with those kinds of trains is not okay. Playing on them - even less acceptable.
Playing the fool with your friends on a moving train is particularly dangerous after the age where you can actually walk independently. Moving doors can crush you, rocking train cars can tip you over, and angry passers-by that you can't stop mooning or bobbing-and-weaving around can lose every remnant shred of their patience, rear up and kick your ass.