While the struggle for approval of the Keystone and Dakota Access pipelines highlights the challenges pipelines face from environmental activists, they may face another threat: the railroad industry. A new study published by the National Bureau of Economic Research finds that the flexibility offered by rail has dampened investment in pipelines.

“As shipping crude oil by rail boomed with the rise of shale, then sank again, the ebb and flow caused many to think of rail as a temporary fix to pipelines’ long permitting and construction challenges,” says Ryan Kellogg, a professor at the Harris School of Public Policy and a researcher at the Energy Policy Institute at the University of Chicago (EPIC). “Our study finds that fluctuations in crude-by-rail volumes actually underscore rail’s flexibility. The ability to ramp rail shipments up and down is valuable to crude oil shippers, and it reduces incentives to make long-run investments in pipeline capacity.”

Kellogg and his co-author, Thomas Covert, an assistant professor at the University of Chicago Booth School of Business and also a researcher at EPIC, explore the tradeoffs between pipelines and rail. While pipelines are generally a cheaper way of transporting oil, they have high up-front costs because they are expensive to build. To cover those upfront costs, prospective pipeline shippers must sign long-term contracts that force them to pay a fee even when they don’t use the pipeline. Rail, on the other hand, allows oil to be shipped to or from many locations along the extensive existing tracks—not just one set line. And, rail shippers can increase or decrease the volume shipped in response to changes in prices. This flexibility allows shippers to decide when, where, and how much oil to ship based on market price signals.

Given these tradeoffs, Kellogg and Covert find that the flexibility of crude-by-rail reduces shippers’ incentives to commit to pipelines, ultimately reducing the amount of pipeline capacity that gets built. Specifically, they evaluate how much larger the recently-constructed Dakota Access Pipeline would have been had crude-by-rail been more costly and less flexible. They find that a $1 per barrel increase in the cost of rail would have caused the pipeline’s capacity to be 29,000 to 74,000 barrels per day more than its actual 470,000 barrels per day capacity. Additionally, the ability of crude-by-rail shipments to reach multiple destinations also affects investment incentives. Without this advantage, the capacity of the Dakota Access Pipeline would have been 26,000 to 64,000 barrels per day larger.

What could make the cost of rail increase in the future? Kellogg and Covert consider what might happen if regulatory policies were enacted that addressed the environmental impacts of railroad transportation. Recent work by researchers at Carnegie Mellon and Pitt shows that accounting for air pollution from locomotives would cause the cost of rail to increase by $2 per barrel. Had that increase occurred at the time that the Dakota Access pipeline was being built, the pipeline’s capacity would have been at least 59,000 barrels per day larger.

“Beyond shedding light on the economics driving one of the most significant developments in the U.S. crude oil industry in decades, our study also shows how a costly but flexible transportation option can impact incentives to invest in durable infrastructure that is cheaper but requires large up-front commitments,” says Covert. “This basic finding can be applied to many other settings involving similar trade-offs between technologies.”

For instance, Covert gives the example of the choice between building dedicated light rail lines, which have large up-front costs but theoretically lower costs in the long run, or relying on flexible bus networks. According to their model, the bus network may be the superior choice in spite of its higher average cost.