The Hatfield rail crash that killed four people was "a disaster waiting to happen", the Old Bailey has heard.
The crash was blamed on a broken piece of rail
A London to Leeds express derailed in Hatfield, Herts, in October 2000 after a stretch of track broke apart as the train sped over it at 115mph.
Prosecutor Richard Lissack told a jury a rail fault had been diagnosed some 21 months earlier and measures could have been taken to avoid the catastrophe.
Five rail managers deny manslaughter and health and safety charges.
The court also heard the men agreed months before the crash the deadline for overdue repairs needed on the line would be reset.
Two managers - Anthony Walker and Nicholas Jefferies - worked for Balfour Beatty Rail Maintenance which had the contract to carry out repair work. The company has also been charged with corporate manslaughter, which it denies.
The other three defendants, Alistair Cook, Sean Fugill and Keith Lea, were employed by Railtrack which owned the line.
The derailment was blamed on a section of track which had cracked and broke as the train passed through at 115mph.
"This is not one snap in one place - 35 metres or so of rail disintegrated beneath that train," prosecutor Richard Lissack QC told the court.
He said Balfour Beatty was charged with manslaughter because its civil engineer, Mr Jefferies, was sufficiently senior that his acts were acts of omission of the company.
Mr Lissack said a rail fault had been diagnosed some 21 months before the accident.
He said the rail which broke, causing the crash was first identified as suffering from fatigue on 22 January, 1999.
By February 2000 it urgently required replacement, he told the jury. Another rail was sitting beside the line waiting to be fitted at the time of the crash, Mr Lissack alleged.
"This simple measure would have avoided the derailment and the deaths," he said.
Speed restrictions that would have prevented the accident were not in place, he said.
"Every defendant knew long before the accident that GCC [a form of fatigue caused by contact with wheels] could cause a rail break.
"A simple step of imposing a speed restriction would mitigate or reduce danger and dramatically reduce the risk of a catastrophic derailment should the line fail as it did.
"The problems were so bad and numerous that had things been done according to the book, Kings Cross would have been shut completely.
"This was no accident - it was a disaster waiting to happen."
Mr Lissack said Mr Walker and Mr Lea met in June 2000 to discuss the "long-standing backlog of faults" on the line.
He told the court the men agreed that the clock which counted the time for carrying out all the overdue repairs would be turned back to zero.
The crash brought an end to wholly privately run rail companies
"All the faults that were overdue for repair were wiped out in the sense that fresh time limits were brought in to address the backlog which built up," Mr Lissack said.
He alleged all the accused were complicit in the agreement.
"This cavalier approach to the safety of those in trains was realised on October 17, 2000," he said.
Railtrack went into administration soon after the crash as inspections and repairs to other lines caused chaos to services. Network Rail took over control of the line.
Mr Lissack also told the court the crash was a "catastrophe" which marked the beginning of the end of wholly privatised railways in Britain.
He added: "But by far the greatest price was paid by the four men in coach G who lost their lives."
Steve Arthur, 46, from Pease Pottage, West Sussex; Peter Monkhouse, 50, of Headingley, Leeds; Leslie Gray, 43, of Tuxford, Nottingham; and Robert James Alcorn, 37, of Auckland, New Zealand were killed in the derailment.
The jurors were told they would visit the site of the crash, probably next Sunday.
The trial, which is expected to last up to a year, was adjourned until Tuesday.