Russ Girling is prepared to accept that he is, for now, losing.

Pipelines built by companies such as Mr. Girling's TransCanada Corp. carry the vast majority of the crude oil shipped around North America. This year, however, nearly 10 per cent of the volume of oil pulled from the ground in the U.S. will not flow through that massive network of buried steel. It will instead be loaded on to trains and race across the continent in a blur of tanker cars that is transforming the way North America's energy moves.

It is a giddy procession of profit, as trains connect western oil wells to coastal and global markets willing to pay far more for crude than the inland buyers attached to the continent's pipeline system.

Story continues below advertisement

It's also a procession of risk. Though accidents remain infrequent, trains leak hazardous materials more frequently than pipelines, have a higher accidental death rate and produce greater emissions.

But they are succeeding where pipelines are stumbling.

Across North America, planned pipelines are running into an outpouring of public discontent largely around environmental concerns, allowing locomotives to increasingly step in as an alternative.

In 2008, fewer than 20,000 barrels a day of crude oil moved on trains in the U.S. By the end of 2012, that number had jumped above 500,000 – a more than 25-fold increase in five years.

Meanwhile, projects such as TransCanada's Keystone XL pipeline, which would carry 830,000 barrels a day to the U.S. Gulf Coast, languish even as existing pipelines out of Canada are stuffed to capacity.

"Short term, the critics are slowing pipeline development. There's no question," Mr. Girling said in a recent interview.

But as he contemplates all of those trains moving barrels that could be flowing in TransCanada steel, he is struck by a rich irony. If pipelines are being stopped on environmental grounds, the result has in some ways been the exact opposite.

Story continues below advertisement

"By denial of the pipeline, safety risk increases. Potential environmental risk increases. Greenhouse gases increase," Mr. Girling says. He adds: "So I'd call it a Pyrrhic victory, where they've slowed down, potentially, the development of the Canadian oil sands for a short period of time – until alternatives are found. But in the short run, they haven't achieved any of these safety or environmental objectives."

Trains have long been bearers of coal, wheat, lumber and a host of consumer goods. They are, for many commodities, blessed with numerous advantages. They move with relative speed. They are far more economical than trucks. They travel across routes created decades and centuries ago, along rights-of-way imbued with all manner of legal rights, a lengthy history that gives them the power to be particularly agile.

Want to build a pipeline? Strap yourself in for a costly, years-long struggle with landowners and governments. Want to move oil on a train? Get a tanker car and load it.

That is exactly what a growing number of oil companies have done. In the U.S., the spectacular ascent of new oil plays in places like North Dakota has far outstripped the ability of pipelines to accommodate new oil volumes. The American Association of Railroads recently distilled the "pipeline on rails" euphoria into a single headline: "Railroads emerge as permanent solution for crude oil shipments."

In Canada, where the pipes to the U.S. are now effectively full, trains have become an increasingly important way around the logjam. Refineries desperate to get crude on the cheap have also turned to rail, which can carry North American oil that sells for far less than international barrels.

But underlying the euphoria is a set of unpleasant statistics. Trains may deliver big new profits to oil companies and refineries alike. They also deliver the potential for problems. The industry itself acknowledges that trains have nearly three times the number of spills as pipelines. The U.S. State Department found that, when moving liquids, trains have a death rate three times higher than pipelines and a fire or explosion rate nine times higher. The U.S. Pipeline and Hazardous Materials Safety Administration says that over all, pipelines beat other modes of transportation on all facets of their safety record.

Story continues below advertisement

"If you're against pipelines, then you have to think about what the alternatives are – and are they better than pipelines," says Terry Lake, the British Columbia Minister of Environment. He is part of a government that has harshly questioned the Enbridge Inc. Northern Gateway project, and laid out a set of strict criteria that have become an obstacle to constructing new pipelines.

Now that oil has begun to move through British Columbia on trains, however, the B.C. government has had to consider the potential unintended consequences of blocking pipelines. In a recent paper that presages changes to the province's land-based spill response, it lists railways alongside pipelines as a potential environmental risk.

"We agree that if you're going to move oil, pipelines are safer than rail or truck," Mr. Lake says. He adds: "That does cause us some concern."

The Wabamun train spill

Shortly after 5 a.m. on Aug. 3, 2005, Jack Latham woke to a bang. He lives just outside Wabamun, Alta., a small town west of Edmonton crossed by a Canadian National Railway Co. track that sees nearly three dozen trains a day. His house is so near the track that in summer, he and his wife sit on his deck and wave to passing engineers.

"We are as close to the tracks as we can legally be," he says. "When we have company it's big excitement: 'Here comes a train!' "

Story continues below advertisement

In 2005, the excitement came for an altogether different reason. When Mr. Latham got up to take a look in the early morning darkness, he discovered a rail car lying on its side on his property. A short distance away, tanker cars carrying Bunker C, a heavy fuel oil used by ships, lay on their sides with product draining out of gashes big enough to walk through. In total, 700,000 litres of Bunker C gushed out, much of it into Wabamun Lake, a popular outdoor destination.

"When we first got there it was just overwhelming," says Bill Purdy, a town councillor and former MLA who was then deputy chief of the local volunteer fire department. He grabbed a piece of lath and stuck it into the oil pooled along the shore. It was six inches deep. At the end of a pier 50 feet out, it was two to three inches deep. The smell "was terrible."

He worried that his community might never recover. The community was worried, too: Residents accused CN of being more concerned with fixing the track than cleaning the spill. It didn't help that CN didn't have enough of the proper containment boom. Some had to be flown in on a cargo plane. A furious debate arose, prompting then-chief executive oficer Hunter Harrison to print a full-page apology in local newspapers. The company eventually paid $132-million to clean up the spill and settle claims. It also paid $1.4-million in fines, and made changes to its spill procedures and equipment.

The company now has emergency response caches in 39 places across Western Canada. CP has more than 10 caches, plus 17 spill-response boxes at rail yards, in addition to several containers with equipment and a network of consultants it can call upon in an emergency.

CN has also begun a "geographic response planning" pilot program along the Skeena River in northwestern B.C. where it has gone out in advance to identify river access points and important features, like cultural sites and environmentally-sensitive areas. Compiling that information can substantially improve a spill response, and CN has, in conjunction with the federal and provincial government, begun to work its way eastward from the coast.

And Wabamun has recovered. Those who live there haven't seen any trace of oil in recent years. What they have seen is more CN.

Story continues below advertisement

"They're sure spending a lot more time on the tracks, checking the tracks out. And we regularly see them out doing track repair," Mr. Latham says.

He acknowledges that there is risk in more oil moving by train. "A properly designed and built pipeline is still a safer method of moving oil," he says. More oil on rails means more trains, and "if they don't maintain the tracks, something is going to happen," he says.

But Mr. Latham is an Albertan. His father worked on some of the province's earliest oil plays; he ran a business delivering propane. He knows the environmental and first nations obstacles that have confronted the construction of new pipelines, and he knows the financial pain that has resulted. That pain is not just hurting companies. It's hurting his home province, which has warned of rising deficits, partly as a result of low oil prices.

And so as Mr. Latham looks out at the trains that rush past his front windows, he sees the tracks beneath as an avenue for help.

"If industry has to take over and do an end-run around the Indians and the politicians, we have to do that to get the oil moved," he says. "That's my view."

The spill comparison

Story continues below advertisement

Railways and pipelines speak different languages. Trains move commodities by the ton or carload. Pipelines move oil by the barrel. So comparing the two can be tough. But those who have tried – including the rail industry itself – have shown that trains are substantially more prone to hazardous materials accidents.

Diana Furchtgott-Roth, a senior fellow with the Manhattan Institute, a right-leaning New York City think tank, was among the first to assemble an in-depth look at the risks. Between 2005 and 2009, U.S. hazardous materials pipelines, she found, had 0.61 spills per billion barrel miles. Railways had 20.5 – a spill rate 34 times higher. (Trucks were far worse yet, at 651.)

"It's very striking that pipelines are definitely the safest," she said. She added: "We need to be building more pipelines, especially with all the oil and gas production that's going on in North America. I think that's the message to policy makers."

The rail industry, in its own analysis, came to a friendlier number: a spill frequency 2.6 times that of pipelines. The American Association of Railroads has also determined that trains leak smaller amounts. "Railways spill less of their hazardous liquid product than do pipelines, 9 per cent less per billion barrel miles over the 20-year period 1990-2009 and 35 per cent less over the 2002-2009 period," the association said.

That conclusion is borne out in some of the worst spills in recent years. CN, for example, leaked 4,400 barrels of Bunker C in Wabamun; a 2009 derailment and explosion near Rockford, Ill., lost 7,700 barrels. Pipeline spills have been worse: Enbridge Inc. leaked 20,082 barrels near Kalamazoo, Mich., in 2010, while Plains Midstream Canada spilled 28,000 in northern Alberta in 2011.

CN, in a statement, said: "Since starting the movement of crude oil by rail in 2010, CN has safely delivered crude oil to destination with no accidents causing the release of product." The company says 99.9973 per cent of hazardous materials moved by rail make it to destination accident-free. (Pipeliner Enbridge, by comparison, boasts a slightly better 99.9996 per cent success rate.)

The rail industry says there are other advantages, too. When a train derails, cleanup can start immediately; in recent years, pipeline companies have taken many hours to identify that a spill is taking place. And unlike pipelines, heavy oil sands crude, called bitumen, is moved by train without dilution. Bitumen looks a bit like a hockey puck at room temperature, and as it loses heat in a rail car, it hardens. Derail a cooled car, and "it's like molasses in January coming out. So you're not going to have a huge problem," said Michael Bourque, president of the Railway Association of Canada.

Little of the oil moving by rail today, however, is heavy oil or bitumen. And rail has other strikes against it. Rail companies have also fought measures to improve the safety of cars with known problems. At CN's Illinois derailment, for example, 13 cars filled with ethanol leaked; some caught fire. One person died. Seven others were injured. In an accident report, the National Transportation Safety Board pointed to "the inadequate design of the DOT-111 tank cars, which made the cars subject to damage and catastrophic loss of hazardous materials."

Those DOT-111 tankers are some 69 per cent of the U.S. fleet. They are used in Canada as well, and have what the NTSB called a "high incidence of tank failure." A new design of tanker car has been used since 2011. But the rail industry has resisted retro-fitting the tens of thousands of existing cars.

Some transportation safety experts have also issued sharp warnings about railways carrying increased volumes of oil.

"If you look at our two major railroads in Canada, they're very unsafe," said Emile Therrien, a past president of the Canada Safety Council who formerly sat on its railways safety committee. He accused government of conducting insufficient safety audits, and said rail companies need to spend "billions and billions" to upgrade their track infrastructure.

The rail industry says it's already doing that: CN spent more than $1-billion last year "on track infrastructure across its North American network," the company said. CP said its "track system is built to accommodate today's trains and we have a comprehensive track inspection program and ongoing maintenance of our infrastructure in place that meets or exceeds federal and industry requirements."

The Railway Association of Canada added: "Canadian rail is by far the safest means of ground transportation in Canada. In 2010, there were 12.89 accidents per million train miles in Canada – a decrease of 80 per cent since 2000."

But fears remain. Last summer, the oil and gas companies that back Western Canadian Spill Services, an emergency response co-operative, asked for detailed information on the emergency preparedness of railways. They were worried. "The board of directors of WCSS are certainly concerned about the amount of product that's being shipped by rail," said Al McFadyen, the group's chief executive.

Mr. Therrien is more blunt: "I just have no faith in the railroads carrying all this oil."