You are not permitted to download, save or email this image. Visit image gallery to purchase the image.
Fire crews from the Kirwee and West Melton stations were called to the blaze between Kirwee and Darfield about 7.13am.
Fire and Emergency New Zealand spokesman Brent Dunn said the fire took about 45min to put out.
Firefighters also checked the rest of the line as a precaution.
Mr Dunn said FENZ is liaising with KiwiRail to ensure the train and tracks are safe to prevent further fires breaking out.
KiwiRail can take steps to reduce the fire risk along train tracks, such as cutting back vegetation near the line, having a water truck dampen the area next to the track and stepping up its inspection regime.