Thirty youths who attacked a slow-moving Melbourne train were given a taste of their medicine as passengers fought back, hurling objects and insults at the vandals.

A video of the incident shows three of the vandals jumping out of bushes and spraying the final Hitachi service with graffiti as it comes to a standstill at Essendon train station.

Metro spokeswoman Leah Waymark said the train was attacked by 30 youths when it arrived at the station abut 3.50pm on Saturday.

She said the trip was not a regular Metro train service, but a special charter train filled with train enthusiasts celebrating the final run of the old Hitachi model.