Fife Fire and Rescue Service is at the scene near Pitreavie industrial estate in Dunfermline, securing the train.
A Network Rail spokesman said: "The front carriage came off the track but it remained upright. There have been no reports of any injuries. The carriage did come into contact with a line barrier but it was not a significant derailment."
Another train travelling between Oban and Glasgow struck a landslip at around 1.30pm but did not come off the tracks.
Scotrail said none of the 69 people on board was injured but trains in the area are being delayed.
A spokeswoman said: "Passengers were transferred into the rear two coaches, which returned to Oban. We have arranged onward transport so that people can continue their journeys."