There were more than 200 faults overdue for repair on the East Coast Mainline in the months before the Hatfield train crash, the Old Bailey has heard.
The crash was blamed on a broken piece of rail
But managers ignored procedures for dealing with the backlog, prosecutors told the court.
Four people died when a Leeds to London express derailed in Hatfield, Herts, in October 2000 after track broke apart.
Five rail managers and the maintenance firm Balfour Beatty deny manslaughter and health and safety charges.
Network Rail, which took over control of the railways from Railtrack shortly after the Hatfield crash, also denies health and safety charges.
Richard Lissack QC, prosecuting, told jurors 219 sections of the track on the line into London's King's Cross Station were overdue for repair in June 2000.
Some rails showed signs of the cracking later found to be the cause of the Hatfield crash, he told the court.
But rather than deal with the backlog using proper procedures, Mr Lissack said the accused managers "stepped outside the shelter of the rulebook".
He accused them of knowingly "courting disaster", says BBC Transport Correspondent Tom Symonds, reporting from the court.
Mr Lissack said this agreement allowed Balfour Beatty to by-pass the proper procedures for the work.
He added that the managers knew the Balfour Beatty did not comply with the required standards.
He told the court: "Dealing with it this way, informally and between themselves, had the effect of avoiding the imposition of speed restrictions which would have been inevitable if standards had been applied accordingly.
"No steps were taken to ensure the condition of the line was reviewed systematically so that the extent of the backlog could be identified, risk-assessed, prioritised and risk mitigation steps put into effect."
Those on trial are Nicholas Jefferies and Anthony Walker, 46, who worked for Balfour Beatty Rail Maintenance, and Alistair Cook, 50, Sean Fugill, 50, and Keith Lea, 53, of Railtrack, which owned the East Coast Mainline.
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.