Emergency services are on the scene and liaising with ScotRail staff.
The incident has resulted in disruption to 22 services.
The line to Inverkeithing has now been reopened. ScotRail said it expected train services to still be affected until at least 8pm.
Passengers had earlier been asked to make alternative arrangements or postpone travel until the incident has been resolved and normal services restored.
The full list of disrupted services can be accessed at www.scotrail.co.uk.