CALGARY, Canada — As the year rolled to a close, Russ Girling, chief executive officer of TransCanada Corp., repeated on television what he has often said: he’s "very confident" that President Obama will approve the Keystone XL pipeline.

CALGARY, Canada — As the year rolled to a close, Russ Girling, chief executive officer of TransCanada Corp., repeated on television what he has often said: he’s "very confident" that President Obama will approve the Keystone XL pipeline.

The problem is that people have been saying that for years. As a result, the oil industry on both sides of the border has begun to aggressively deploy alternatives to the pipeline, including shipping by rail and barge, to get that oil to U.S. Gulf Coast refineries.

Rail, though, poses its own issues. A train carrying hazardous materials, including crude oil, derailed and caught fire Tuesday in New Brunswick, Canada, causing the evacuation of as many as 150 residents — the latest serious accident involving rail cars hauling flammable liquids.

The tilt toward rail is rooted in an industry sense that more than five years after it was first proposed, the $5.4 billion Keystone XL project seems stuck in a deepening impasse caused by shifting U.S. environmental politics and a radically reordered American energy landscape.

Once framed as a fight over how the line’s route might harm Nebraska prairie land, Keystone has been recast as a fight against global warming by increasingly vocal green groups who have chained themselves to equipment and brought in actor Robert Redford to battle the project. Their stand seemed to gain traction from Obama, when he declared in June he wouldn’t approve the project if it exacerbated "the problem of carbon pollution."

While the pipeline is being reviewed, the U.S. has also undergone an energy transformation owing to the shale oil and natural gas boom. Output from fields in North Dakota and Texas has pushed production past 1988 peaks, helping to explain how the U.S. is estimated to have surpassed Saudi Arabia and Russia as the world’s top oil and gas producer last year.

So even as owners of Gulf Coast refineries have fine-tuned them in anticipation of processing the estimated 800,000 barrels a day Keystone would ultimately deliver, oil supply is not the pressing issue it once was — rendering Keystone more of an option than an absolute must for U.S. energy needs.

"It gives the U.S. administration, if nothing else, a reason to sit on the fence," said Sandy Fielden, director of energy analytics at RBN Energy LLC in Austin, Texas. If shale didn’t exist, "the importance of securing supply from friends and allies would be more important."

Keystone backers may see opposition soften in the face of high profile incidents associated with moving millions of barrels of oil by rail. Canadian and U.S. oil interests still want the pipeline, which they say will form the backbone of a new North American oil supply that will create U.S. jobs, keep those Gulf Coast refineries humming and allow Canada to expeditiously develop its largest oil asset.

Canadian Prime Minister Stephen Harper has said he won’t take no for an answer on Keystone, calling the project an economic "no-brainer."

Behind that bravado is concern that the portion of the route under review, a 1,179-mile (1,897-kilometer) leg from Canada to Steele City, Nebraska, may never win approval. The entire Keystone, fully built out to the Gulf of Mexico, would cover about 2,000 miles.

"There’s growing concern over the extended uncertainty of Keystone," said Bob Schultz, a professor at the University of Calgary’s Haskayne School of Business.

The major Canadian response to this U.S. foot-dragging has largely amounted to a four-letter word: rail.

"I think at this point the companies have said, ‘If Keystone goes, that’s fine, if it doesn’t go, we’ll ship it by rail,’" Schultz said.

That’s already happening. Exxon Mobil Corp.’s Imperial Oil Ltd. last month announced what may be the biggest oil-by-rail loading terminal yet if expanded to the full potential of 250,000 barrels a day, built to accommodate production from its Kearl oil-sands project.

Canadian producers are backing proposals to move as much as 1.1 million barrels a day by rail in the next three to five years, five times more than last year, according to the Canadian Energy Research Institute.

Cenovus Energy Inc., which has bigger reserves than Yemen, was moving 11,000 barrels a day by train to coastal markets in 2013 and plans to ratchet that up to 30,000 barrels a day by year-end, said CEO Brian Ferguson. Rail and barge transport will form a "significant" part of Cenovus’ oil-export strategy, he said.

The U.S. output boom created competition between crudes and woke the energy industry to the viability of using rail and barge to transport oil, as producers and refiners worked around a shortage of pipelines, said Skip York, principal analyst in oils research at Wood Mackenzie Ltd. in Houston.

"Now with tight oil, there is a new supply source we didn’t see," York said. "Those tight oil barrels that don’t go to the East and West Coast are going to go to the Gulf Coast. There’s a now a new competitive dynamic where the refiners that can increase their take of light oil versus heavy, they now have a choice."

Rail transit raises its own issues, among them the safety of moving that much crude over a system in which accidents involving crude-bearing tanker cars have grabbed headlines. Moreover, it poses questions for activists who oppose Keystone on environmental grounds, since the crude winds up in the U.S. anyway.

Beyond the safety issues, shipping by rail means "more cost, less efficiency, more greenhouse-gas emissions," said TransCanada’s Girling. But the prolonged delays give the industry little choice, he said.

Incidents like the runaway train full of oil from North Dakota’s Bakken region that exploded and killed 47 people last year in Lac-Megantic, Quebec, haven’t so far dented the growth in rail shipments.

Last month, 1,500 North Dakota residents fled fumes from a fire that engulfed Burlington Northern Santa Fe LLC railway cars carrying oil, after a collision with another train about 25 miles west of Fargo. The Transportation Department said Jan. 2 that oil pumped from North Dakota may be more flammable and thus more dangerous to ship by rail than other crude.

Environmentalists say the Canadian oil industry is exaggerating its ability to develop its oil sands by using rail if Keystone is killed.

Trains are "not a substitute" for Keystone XL, but a "niche market" that favors transporting light oil and not the thick oil-sands bitumen that requires special heated rail cars, Anthony Swift, an attorney for the Natural Resources Defense Council, wrote in a recent blog post. "Expansion of tar sands depends very much" on Keystone’s approval, according to Swift.

Environmentalists also note that pipelines are subject to accidents as well.

A State Department draft report last year said Keystone wouldn’t worsen climate change because the oil sands could be developed without the pipeline, moving to market by other means including rail. The government is in the midst of putting together a final report — whose results may be released within weeks — that will be based on input to the draft that includes environmental arguments against it.

"What people don’t understand is the magnitude of the asset and the magnitude of the production increases" that would follow Keystone’s approval, said billionaire Tom Steyer, an Obama fundraiser who has urged him to kill the pipeline. "Once it’s built, it will enable this thing to run for decades."

Steyer has pledged to spend millions to back anti-Keystone candidates in the November Congressional elections.

Rejecting the project carries its own risks for Obama. Many union supporters of the president favor the project for the jobs it would create. Rejection could damage America’s relationship with Canada, its largest trading partner and biggest source of energy imports. Oil is Canada’s most valuable export, worth more than C$70 billion annually to the world’s 11th-largest economy.

Canadian unconventional oil production, mainly in the form of oil-sands bitumen, has increased 71 percent since 2007 and makes up 2 percent of Canada’s economy, up from from 1.3 percent six years ago.

On the Gulf of Mexico, refiners from Total SA to Royal Dutch Shell Plc spent more than $25 billion to upgrade U.S. refineries so they could process what they thought would be an avalanche of heavy oil from Canada, Mexico and Venezuela. Discounted prices for Canadian crude were the Holy Grail for producers to squeeze more profits from their billions worth of investments.

Instead, the U.S. oil boom has flooded the Gulf Coast with light crude, so much so that this year it is likely to become cheaper than heavier grades, turning industry economics on their head, said RBN Energy’s Fielden.

"Refiners will be in a strong position and there will be downward pressure on light crude because there’s too much floating around," he said. The price of Canadian benchmark heavy crude has risen 32 percent in the past 12 months.

Meanwhile, rail, barges and Enbridge Inc.’s Seaway pipeline are helping to keep refineries full. Within the next several months, Valero Energy Corp., one of the original backers of Keystone XL when it was proposed in 2008, will be able to ship as many as 55,000 barrels a day of heavy Canadian crude via rail and on Mississippi River barges.

Oil producers on both sides of the border may prefer shipment by pipeline, but have no choice but to adjust to the uncertain U.S. political realities, including Obama deferring a decision on Keystone to the next administration.

"Pipelines are still the most efficient, the most economic way to move oil," said Peter Howard, CEO of the Calgary-based Canadian Energy Research Institute. "Plan B for the short term, call it five years, is rail."