Peter Singleton, 29, was three times the drink-drive limit and nearly eight times over Network Rail limits while he was supposed to be manning a busy level crossing.
While he was supposed to be paying attention to the control barrier where 65 passenger, freight and express trains pass per day, he was instead unconscious in his cabin when a colleague arrived to relieve him.
The worker tried to rouse Singleton by pinching his ears so they could open the gate and allow the train to pass at 8.15pm on October 18.
Prosecutor Diane Gomersall told Wakefield Magistrates Court that the colleague had noticed a waiting passenger train 250 yards up from the crossing at Doncaster Road, Crofton, near Wakefield, and he expected Singleton to come out of the gatekeeper’s cabin to close the gate.
But all he could hear was a buzzing at the door, indicating a signalman was requesting the gates to close.
She said: “He could see the defendant in his chair with his head back and his eyes rolled back.
“The crossing is known to be the second busiest in Europe due to the nearby depot.”
The colleague pinched Singleton and called his name but couldn't wake him.
An ambulance was then called before they managed to rouse him.
Singleton, a recovering alcoholic who also had issues with bulimia, had worked for Network Rail for six years.
He said he had drunk three pints of cider before coming on duty.
However, a manager said he had checked on Singleton twice during the day and he hadn't smelt alcohol.
A breath test revealed he had 99mcg of alcohol in 100ml of breath. The legal driving limit is 35mcg but Network Rail has its own policy of 13mcg for staff.
The court heard an empty two-litre bottle of cider was found in his locker at work.
Singleton, who told police he was a crossing keeper in a “safety-critical” role, admitted working on a railway while unfit through drink.
Mike Devlin, mitigating, said: “He had no intention to drink it at work that day.
“At some stage later on the shift he did drink that cider.”
The court heard Singleton had been suspended on full pay but accepted he was certain to lose his job.
Magistrate Barbara Phipps said the offence was made worse by the fact Phipps was virtually unconscious while doing a job which affected people’s lives.
She warned Singleton who lives at Roger Drive, Sandal, near Wakefield, that he could face custody when he is sentenced later this month.
A Network Rail spokesman said afterwards: “Safety of the railway is our number one priority and we have a strict drugs and alcohol policy.
“This incident is being treated very seriously in accordance with the correct HR procedure.
“The crossing is protected by modern safety systems which directly link it to the signaller in the signal box.
“Therefore it was not possible for the gates to be open or closed inappropriately without the signaller being aware and taking appropriate action.”
A British Transport Police spokesman said afterwards: “I can confirm that Peter Singleton was charged with one offence of transport worker unfit through drink or drugs.
“This is in relation to an incident at Crofton level crossing, Wakefield, on Tuesday, 18 October.
“Front-line rail staff are working in a safety critical environment and it’s obviously crucial that their competency is not impaired in anyway. That is why Parliament passed the Transport and Works act.”
The spokesman added: “These incidents, although rare, are taken very seriously and safety is at the heart of all rail industry operations.”