Emergency services were called but the boy was pronounced dead at the scene.
Edinburgh crime news: Teenage boy arrested after riding motorbike in a 'dangerous manner in a public place'
Tom Jones Edinburgh: Princes Street Gardens concert stage times, support, setlist and how to get there
Edinburgh fire: Blaze breaks out at Franco's fish and chip shop in Newington
Olivia Newton-John: John Travolta leads tributes to Grease co-star following her death at 73
West Lothian crime: Man, 33, arrested after assault and theft in Livingston and robbery in Broxburn
A spokesman for British Transport Police said the boy’s family have been informed and are receiving support from specialist officers.
He added: “The boy’s death is not being treated as suspicious and a report has been submitted to the Procurator Fiscal.”
Disruption to services on the train line where the boy was hit lasted for about three hours.
At the time, a ScotRail spokesman said: “Unfortunately, we've had reports of a person being struck by a train between Falkirk Grahamston and Linlithgow.
"Lines have now reopened. Disruption is expected until 12.30am.”
Samaritans are available to anyone having a difficult time on 116 123.