The teenager who died after poking his head out of a moving train is believed to have been part of a group of boys who broke into an unattended rear driver's cabin, wreaking havoc inside.

The boy – 17-year-old Jack Irving, of Beaumaris – was believed to have been with three other teenagers, who broke into the back carriage of the Caulfield-bound train, near Malvern train station on Friday night, Rail, Tram and Bus union Victorian secretary Luba Grigorovitch said. Jack's younger brother, Nicholas, was with him at the time.

It is understood Jack stuck his head out of the moving train, and was clipped by a signal panel before being dragged out of the train, Ms Grigorovitch said. The accident happened about 200 metres from Malvern station.

Ambulance Victoria spokesman Ray Rowe said paramedics treated the teenager at the scene for upper body and leg injuries.

He was taken to The Alfred hospital in a critical condition but died shortly before 11pm. No other passengers were injured.