Fatigue could have played a part in a signaller failing to help stop a woman being killed on a railway line, a report has said.
The Rail Accident Investigation Branch has recommended signal workers report tiredness and get enough sleep before starting shifts after the death.
The woman was hit by a train near Llanharan travelling from Cheltenham Spa to Maesteg on 1 June 2017.
She had been reported to signal staff 20 minutes before her death.
The investigation report said an earlier train driver had spotted her at the Trenos crossing and the guard spoke to her.
He was concerned "about her state of mind" and asked a signaller to stop trains at signals before the crossing and advise drivers to proceed with caution.
But after putting signals to red 0.7 miles (1.2 km) away, the signal operator returned them to green shortly after so the driver of the train involved was not cautioned and the train approached the crossing at normal speed.
The report said tiredness could have played a part, reading: "It is possible that cautioning the train in accordance with railway rules would have avoided the accident.
"It is possible that the Port Talbot signaller's decision making was influenced by fatigue."
Among a number of learning points, it noted the "responsibility of staff to both report fatigue to their managers and to arrange their off-duty time so that they have sufficient sleep before the start of a shift".
Network Rail said safety on the railways is their "priority" and incidents such as this are "rare".
"We welcome the RAIB's report and we are implementing the key findings as part of our ongoing commitment to improve safety on the railway," said a spokesman.
"We will now carefully review the report to see what further action is necessary."