A man was found lying unconscious close to the main London-Brighton railway line near Haywards Heath.
Police were warned a 25-year-old man might have wandered on to the track at about 3.10pm yesterday.
Train drivers were alerted and a 15mph speed limit put in place.
One of the drivers spotted the man lying near the line and was able to stop before hitting him.
The train remained stationary for 50 minutes while police moved the man.
Sergeant Barry Carpenter said: "Initial reports indicated there was a boy on the track but when we arrived we discovered a 25-year-old man.
"Although the man was not seriously injured he was taken to the Princess Royal Hospital in Haywards Heath, where police interviewed him."
The incident caused delays on London to Brighton trains.
Comments: Our rules
We want our comments to be a lively and valuable part of our community - a place where readers can debate and engage with the most important local issues. The ability to comment on our stories is a privilege, not a right, however, and that privilege may be withdrawn if it is abused or misused.
Please report any comments that break our rules.
Read the rules hereComments are closed on this article