The name of the victim has not been released until her next of kin have been informed.
Police, who have said that they were not treating the death as being suspicious, were notified of the incident near Wittet Drive.
The Scotrail service had left Aberdeen at 5.15pm bound for Inverness.
A spokesman for Police Scotland said: “Officers were called to an area of railway line where the body of a woman was found.
“The death is being treated as unexplained at this time but there are no apparent suspicious circumstances.”
Trains on the line were halted between Elgin and Forres throughout the evening.