A passenger train approached a level crossing at nearly three times the speed limit because of computer problems, a report said.
The train was travelling at 80km/h (50mph) in Gwynedd, breaking the limit of 30km/h (19mph), which aims to give people time to cross safely.
No accidents were caused due to the speed between Barmouth and Llanaber.
But the chief inspector of railways said the industry had to learn "important lessons".
Simon French said nobody running the railway at the time had any idea anything was "amiss".
The Rail Accident Investigation Branch (RAIB) report into the incident made five recommendations, including improving computer safety measures.
It found information about temporary speed limits failed to be transmitted to four trains using the line on the morning of 20 October 2017.
Since 2011 a new digital system has been in place which sends information to displays in the drivers' cabs.
The system shows whether trains are allowed to be on particular lines, and what speed they are permitted to travel.
The RAIB found the temporary speed limit data was not uploaded, despite the control room screen saying the safety data had been sent to trains.
On 20 October, the first three services used the line unaware of the speed limit, but a fourth train, the 08:52 Machynlleth to Pwllheli service, went between Barmouth and Llanaber at about 80km/h, in a section limited to 30km/h.
The speed restriction had been in place since 2014 to give level crossing users plenty of warning of approaching trains.
The RAIB report recommends both Network Rail and the computer company Hitachi Rail STS improve their safety processes.
Mr French said the computers had given "valuable experience for engineers and operators", but he said some incidents "were potentially dangerous."
Network Rail and Hitachi Rail STS have been asked to comment.