Train drivers had refused to drive along the section of track where a train derailed last night because it was in need of maintenance, the Rail, Tram and Bus Union has said.

The train’s driver and pilot were both killed in the accident, while a further 12 people were treated for injuries.

“The Sydney to Melbourne XPT train derailment near Wallan Station last night occurred over a section of track over which was awaiting maintenance,” the union’s state secretary Luba Grigorovitch said in a statement.

“Conditions were altered and V/Line drivers rightly refused to traverse this section over the past week.

“Our thoughts are with all those affected by this tragedy, from other rail workers, affected passengers and the family and friends of all those grieving from this incident.”

The derailment occurred near Wallan, 45km north of Melbourne.

The cause of the crash has no been confirmed, however V/Line had regularly warned passengers of delays caused by “an ongoing rail equipment fault at Wallan”.

The company had tweeted such updates throughout the week, including on the day of the derailment.

The train driver, a 54-year-old ACT man, and the train pilot, a 49-year-old Castlemaine woman, were trapped in the driver’s carriage which was overturned in the incident.

One passenger was airlifted to Royal Melbourne Hospital with upper body injuries, while a further 11 were treated at local hospitals for minor injuries.

The union said it was “deeply saddened” by the “tragic accident”.

Image: AAP / David Crosling