The railroad put the small lakeside town of Lac-Mégantic on the map. And over the weekend, the railroad wiped part of the town off the map.

Founded in 1884 when the Canadian Pacific Railway began construction on the final leg of track linking Montreal and the Port of Saint John in New Brunswick, Lac-Mégantic was shaken Saturday when an oil-laden train bound for a Saint John refinery derailed and exploded, leaving at least 13 dead and dozens unaccounted for.

The Montreal Maine & Atlantic Railway train, with 72 cars of crude oil from North Dakota’s Bakken basin, was left unattended by its conductor and rolled downhill, blowing a hole in downtown Lac-Mégantic, likened to “a war zone” by Canadian Prime Minister Stephen Harper. The dead found Monday were burned beyond recognition, officials said.

The explosion near the border of Maine also reverberated in the rest of Canada and the United States, where people are hotly debating what mode of transportation is safest and most economical for carrying the steadily growing output of crude oil from North Dakota and northern Alberta’s oil sands. And it reignited calls for tougher standards for ethanol and crude oil tank cars.

U.S. railroads are already carrying more than 1 million barrels of crude oil a day, bolstered by new shale-oil boom regions such as North Dakota and Texas. Proponents of the controversial Keystone XL pipeline may now be bolstered by arguing that pipelines are safer and more fuel-efficient than trains.

“We’ve seen over and over that derailments are not a matter of if but when,” said Brett VandenHeuvel of Columbia Riverkeeper, part of a nongovernmental network devoted to protecting waterways. “We know a train derails, and when it is carrying hazardous cargo, it’s a threat to our public safety, our economy and our environment.”

VandenHeuvel, who has worked to stop coal, liquefied natural gas and oil export plans, is opposing a proposal by refiner Tesoro to ship 380,000 barrels a day of oil by rail for export from a terminal in the port of Vancouver, Wash. Port officials have scheduled a vote on the project for July 23.

While most environmental and industry groups refrained from doing more than offering condolences to the people of Lac-
Mégantic, the implications could be profound.

The State Department said in its recent environmental impact statement that if a permit for the Keystone XL pipeline is denied, oil producers would simply send their product to markets via railroads. The pipeline would carry oil from northern Alberta to the Texas Gulf Coast. As a result, the State Department reasoned, blocking the pipeline would have no beneficial impact on greenhouse gas emissions because the oil sands would be developed anyway.

A heightened sense of danger about rail cuts both ways in the Keystone debate. On the one hand, climate activists can argue that the dangers of rail make it a less viable alternative and strengthen their argument that denying a permit for Keystone could stop some oil-sands development.

On the other hand, if rail developments proceed despite a heightened sense of danger, then pipeline supporters can argue that pipelines are safer. ­TransCanada, owner of the Keystone pipeline network, has said that it is exploring a pipeline conversion from gas to oil that would go to the Saint John refinery and port.

Many environmentalists oppose both rail and pipelines. “The answer is there’s no safe way to move this oil around,” said Eddie Scher, spokesman for the Sierra Club. “What we need to do is to get the hell off oil.”

Oil refiners favor both rail and pipelines.

“We believe there’s going to be a lot of both, and that’s a function of where the crude oil is coming from,” said Bill Day, a spokesman for Valero, the nation’s largest oil refiner. Valero has ordered 5,300 rail tank cars and would be a major customer of the Keystone XL pipeline. “Much more is being produced on land than [is] being brought in by ships from overseas, which is a shift from before,” Day said. “That means it’s going to travel over land, which means pipelines, rail and barges.”

Over the past two years, the increase in crude oil shipped by rail in the United States has bolstered the fortunes of railroads, many of which have seen coal shipments drop substantially. Canada’s railroads are experiencing the same boom now. The Canadian Railway Association estimates that companies will ship as many as 140,000 tanker cars of crude oil on Canada’s tracks this year — up from 500 carloads in 2009. The Quebec disaster is the fourth freight train accident in Canada this year involving crude oil shipments, the Associated Press reported.

The Association of American Railroads on Monday pointed to statistics that it said showed that pipelines have an average hazmat spill size more than four times that of railroads and that their total amount spilled per billion ton-miles is about 1.6 times that of the railroads. The group said that from 1990 to 2009, the pipeline spill ratio was about 1.25 gallons spilled per billion barrel miles and that the railroad spill ratio was about 1.13 gallons or 9 percent lower.

Last weekend’s disaster will tilt those figures, though the size of the spill is still unclear. From 2002 to 2012, U.S. railroads spilled 2,268 barrels of crude oil, according to Pipeline and Hazardous Materials Administration data cited by the AAR. Photos of Lac-Mégantic showed crumpled tank cars, each carrying 600 to 700 barrels. Canadian officials said oil had spilled in town and into the lake.

At least a handful of the tanker cars that crashed at 1:15 a.m. Saturday were older models known as DOT 111s in the United States. These models, which make up about two-thirds of the U.S. tanker car fleet, have been criticized by the National Transportation Safety Board in earlier incidents as “subject to damage and catastrophic loss of hazardous materials during the derailment.”

Canadian newspapers reported that as many as 1,500 of the town’s 6,000 residents were evacuated.

Edward Burkhardt, chief executive of Chicago-based Rail World, which owns Montreal, Maine & Atlantic, plans to visit the site Tuesday. He said the company would do its own investigation of the cause of the accident. On Monday, officials pointed to the possibility that an earlier fire in one of the locomotives damaged the air brakes.

In a news release, the company said its employees “remain in a state of shock over this incident.”