If all goes as planned in August, a freight train will chug down a track near Pueblo, Colo.—entirely controlled by computers. Humans in the locomotive will merely observe, as the latest in artificial intelligence and sensor technology puts thousands of tons of steel through its paces.
The experiment, on 48 miles of track at the railroad industry’s advanced testing ground, is a big step in the push for autonomous train technology. The outcome could fundamentally alter the railroad industry.
While still a huge, highly profitable business, railroads move less freight than they did 10 years ago, and their biggest customer—the coal industry—is in long-term decline. Almost $700 billion in cargo moved by train in 2017, the latest government figures show, but trucks carried far more, over $12 trillion.
To catch up, rail companies must appeal more to faster-growing segments of the economy, like e-commerce, which require speedier and more reliable deliveries. Automation, railroads hope, is the answer because it could reduce fuel costs and increase capacity by enabling trains to run faster and closer together.
“I don’t think there’s much debate: This is where the railroads need to go,” says Cowen and Co. analyst Matt Elkott, who forecasts extensive automation in the industry within five to seven years.
That reinvention effort is setting off a race to add A.I., machine learning, and other high-tech features to the rail system. Age-old railroad equipment makers like Siemens, Wabtec, and Knorr-Bremse are up against tech companies like Nvidia, Microsoft, and Hitachi.
Most of the tech components—including ones that reduce fuel consumption and control emergency braking systems—have already been deployed in piecemeal fashion. What’s needed is A.I. to tie them together and testing to persuade all the stakeholders to go along for the ride.
But even if the tests go well, autonomous trains face several challenges. The first is powerful railroad unions, which have fought bitterly over crew sizes. Next, the industry would have to overcome public fears that autonomous technology is unsafe. And finally, sometimes-skeptical regulators would have to give their seal of approval.
“Of course we’ll be able to do it,” says Ulisses Camilo, CEO of New York Air Brake, the company whose technology will be tested in Colorado. “The question is how fast.”
The groundwork for autonomous rails was laid as part of a 12-year, $10 billion safety upgrade to North America’s system that should be completed by next year. The overhaul started in 2008, after 25 people died in the head-on collision of a commuter train and a Union Pacific freight train in Chatsworth, Calif. (a distracted engineer blew past a red signal light).
In response, Congress mandated that the entire system be upgraded with automatic safety overrides. Known as Positive Train Control, or PTC, the program includes sensors on tracks and switches that send information to central servers, telling trains about traffic and conditions ahead. If an engineer fails to slow or stop a train, the system can automatically intervene. Still, by itself, PTC is equipped to handle only a few types of emergencies, like a missed signal or a train traveling too fast around a sharp curve.
In some ways, the railroads should be able to adapt or borrow from many of the camera, radar, and lidar technologies used in self-driving cars and trucks. One big difference: Stopping a freight train can take a mile or more (versus 300 feet for a fast-moving car).
Already, mining giant Rio Tinto is using fully autonomous trains in Australia to deliver iron ore from 16 mines to ports hundreds of miles away. By the end of last year, the company said it had safely completed almost 3 million miles of autonomous travel.
Despite the potential benefits of automation, major freight railroads declined to comment to Fortune on the issue. Union negotiations in the fall make this a sensitive time, particularly because railroads will likely propose reducing train crews to just one person from two.
Railroad unions see automation as yet another effort to reduce their ranks. When the Federal Railroad Administration asked for public feedback last year about autonomous rail, it was flooded with 3,400 comments, 99% of which were in opposition.
“The technology is flashy, but it is not ready for prime time,” warns Fritz Edler, special representative for the Railroad Workers United union. Reducing train crews to one person and depending on automation would be “demonstrably dangerous,” he says.
The federal government hasn’t moved forward with a plan for autonomous trains yet, but it may have showed its hand in June when it killed an Obama-era proposal that would have enshrined into law two-person crews.
Even as the railroad industry debates automation, the rival trucking industry is pushing ahead, with both self-driving technology and electric vehicles that may be much cheaper to operate.
Says Tony Hatch, an independent transportation industry analyst: “The railroads have to respond.”
This article originally appeared in the August 2019 issue of Fortune.
More must-read stories from Fortune:
—How the government should spend Facebook’s $5 billion fine
—Cloud gaming is big tech’s new street fight
—Should companies bolster their cybersecurity by “hacking back”?
—FaceApp’s Russia link is the latest alarm in an ongoing digital red scare
—Equifax may owe you some money. Here’s how to get it
Catch up with Data Sheet, Fortune‘s daily digest on the business of tech.