Just past noon on a Friday in June, a Union Pacific freight train carrying oil jumped the tracks in a small town in Oregon, not far from a school filled with children, and exploded in flames that burned for 14 hours.

Bad tracks were cited as the cause, but federal regulators said a better braking system on the train — based on newer technology — would have contained the disaster. The railroad industry newsletter said the notion that the brake system would have made a difference was “horse manure.”

It was another skirmish in a battle over safety standards that often pits federal regulators against an industry. And while such fights are not uncommon, federal officials say this is one that keeps them awake at nights because of the high stakes — what if the next oil train crash happens in a major metropolitan area?

Regulators have mandated a new electronically controlled braking system that would prevent — or lessen the severity of — such crashes as the one in Oregon. The railroad industry calls the requirement a classic example of regulatory overreach. Lawmakers responded to the industry complaints by requiring a pair of new studies that could delay the regulation set to take effect in 2021.

One congressional requirement, for example, stipulates that a train be wrecked to see how many of its cars derail and leak their flammable contents.

“It was deliberate and intentional by the railroad industry to try to make this study as expensive as possible,” said John Risch, who spent 30 years as a BNSF Railway engineer before becoming a rail union lobbyist in Washington. “It's completely unreasonable. You wouldn't see that in maritime, you wouldn't see that in aviation; they do this stuff computer-simulated.”

The railroad industry counters that the new regulation would force it to spend billions of dollars on a braking system that research has not conclusively proven to be more effective than what's already in use.

With the Trump administration taking office in January amid promises to roll back regulations, the railroads hope Congress will hear their concerns.

Included in a post-election message to the Senate from Edward Hamberger, president of the Association of American Railroads, was a plea for “stopping unfounded regulatory efforts.”

There have been 19 derailments of trains loaded with flammable liquid — oil or ethanol — in the past six years. Those wrecks have caused 3,272 evacuations, spilled almost 2.8 million gallons and cost an estimated $45 million. A remarkable percentage of those derailments happened in small towns — Plevna, Mont. (pop. 162), Tiskilwa, Ill. (pop. 829), Arcadia, Ohio (pop. 590), and Alma, Wis. (pop. 781).

But federal officials are increasingly concerned that one of the long trains rolling out of the Bakken oil fields, underlying parts of Montana, North Dakota, Saskatchewan and Manitoba, will explode in a major city. Oil trains snake through cities such as Seattle, Chicago and Philadelphia on their way to coastal refineries. Chicago officials deemed the risk serious enough that the city did a detailed evaluation of the impact should a train explode in various neighborhoods.

Railroads say they have taken every prudent step possible to prevent disasters such as the Lac-Megantic, Quebec, explosion in 2013 that killed 47. They say it is expensive overkill to require electronically controlled pneumatic braking systems on trains carrying explosive cargo.

The railroads estimate it would cost more than $3 billion to install electronic breaking on the required number of engines and cars, and to educate workers.

The Federal Railroad Administration says it would cost a still-hefty fraction of that: $493 million.

From that simple difference — albeit almost $2.6 billion — the divergence of opinion and calculations between FRA and the railroads spirals rapidly out of control.

The FRA estimates 2,500 locomotives would need to be equipped at a cost of $49,000 each. The railroads say 20,000 locomotives — 83 percent of those they operate — would need ECP, at a cost of $88,000 each. The FRA says 60,000 tank cars need the electronic brakes; the railroads say it is 133,000.

How many railroad workers would need training? The FRA says more than 51,000, the railroads, 78,000.

Even more emphatic is the difference in opinions.

“These are not grain trains, these are hazmat trains,” FRA Administrator Sarah Feinberg said. “We specifically require the better braking systems on these trains because in the event of an incident, fewer cars will derail and fewer cars will puncture, which means you're less likely to have a fire that will endanger lives.

“The science is there, the data is there,” Feinberg said. “Their argument is, despite that data, (they) don't want to spend the money on it.”

Risch, the former BNSF engineer who has operated trains with ECP brakes, calls them “the foundation of safety in the future of the railroad industry. When a train crew overlooks something, ECP brakes can save the day.”

The railroads disagree.

“ECP braking technology will not result in fewer accidents, does not provide significant safety benefits and, after 15 years of limited rail use, has yet to meet service reliability standards,” said Justin Jacobs, a spokesman for Union Pacific, the country's largest railroad.

At BNSF, the second-largest, spokesman Mike Trevino has a similar view. “The contention has been that electronic brakes are better, safer, more efficient,” he said. “The challenge is that railroads have been unable to prove that out, to demonstrate that there are those benefits.”

Ed Greenberg, spokesman for the American Association of Railroads, said, “The ECP brake signaling system has been found to break down more often, while not providing significant safety benefits.”

Conventional brake systems on freight trains use air pressure that moves from one car to the next — from the engine to the last car — to engage the brakes and slow the train. On a train of 100 or more cars — and many oil trains are that length or longer — it takes 7 to 8 seconds until the last car's brakes begin to engage. The cars farther back keep pushing against those in front of them as they await the signal to brake. If tank cars have less than a full load of liquid, the sloshing as the train slows adds to their momentum.

With ECP braking, the brakes begin to engage on every car almost the instant the engineer presses a button.

“Trains are like giant Slinkies,” said a railroad analyst who spoke on the condition of anonymity because he works in the industry. “When you have that back of the train running into the front of the train, they can actually push cars out, cause a derailment and cause a hell of a mess.”

When the brakes are applied electronically to each car at the same time, he said, that takes “the energy out of the train quicker, so when a train does derail there is less energy that has to be absorbed by crushing tank cars.”

Railroads already were under pressure to fulfill another federal mandate that followed a California railroad disaster. In 2008, a head-on collision between a freight train and a commuter train in Chatsworth, a Los Angeles suburb, killed 25 people and injured 135. Congress ordered that trains be equipped with an automatic braking system that would have prevented the crash.

Railroads said they had already pumped $6.5 billion into that automatic system last year, when they begged Congress to extend a looming deadline until 2018. The lawmakers came to the rescue.

Three key congressional leaders are among the top 10 recipients of campaign contributions from the railroad industry, which has spent upward of $60 million on campaign contributions since 1990. According to federal data compiled by the Center for Responsive Politics, House Transportation Committee Chairman Bill Shuster, R-Pa., has received $566,479, Senate Majority Leader Mitch McConnell, R-Ky., has received $449,615, and John Thune, R-S.D., chairman of the Senate Commerce, Science and Transportation Committee, has received $353,885 from the railroads.

Congress appended the requirement for the pair of ECP tests to the mammoth five-year transportation bill. One version of the bill would have entrusted the testing to a committee made up primarily of the railroads, but others involved in the talks insisted that the work be done by contractors free of conflicts of interest.

The first report requested by Congress came from the Government Accountability Office last month. The GAO questioned federal estimates of the cost benefits of ECP brakes. The report also said that limited data shared by railroads with the FRA “hampered its efforts to estimate ... their potential benefits.”

In Mosier, (population 433), they say the wind blows at 30 mph from March to October, but on Friday, June 3, the wind took a holiday. The train carrying Bakken crude from North Dakota to a refinery in Tacoma, Wash., derailed and exploded at lunchtime. Nobody was killed or injured, but schools and some residents were evacuated.

Fire Chief Jim Appleton told KGW television that on a typical windy day, the school and the town would have been at risk.

“I have a high degree of confidence that the school building would have been at a minimum affected, if not completely incinerated,” he said.