WASHINGTON — The Amtrak train that derailed in Philadelphia on Tuesday night was equipped with an automatic speed control system that officials say could have prevented the wreck, which killed eight passengers and injured hundreds. But the system, which was tantalizingly close to being operational, was delayed by budgetary shortfalls, technical hurdles and bureaucratic rules, officials said Thursday.

In 2008, Congress ordered the installation of what are known as positive train control systems, which can detect an out-of-control, speeding train and automatically slow it down. But because lawmakers failed to provide the railroads access to the wireless frequencies required to make the system work, Amtrak was forced to negotiate for airwaves owned by private companies that are often used in mobile broadband.

Officials said Amtrak had made installation of the congressionally mandated safety system a priority and was ahead of most other railroads around the country.

But the railroad struggled for four years to buy the rights to airwaves in the Northeast Corridor that would have allowed them to turn the system on.