Prime Minister Justin Trudeau’s welcome of the Keystone XL reversal in Washington has alienated many environmentalists in Canada, and has also strained his relations with some indigenous communities.CreditTodd Korol/The Canadian Press, via Associated Press

The move is likely to complicate a delicate balancing act Mr. Trudeau has been trying to keep up: He has long maintained that Canada needs to develop its energy industry, but he also stands for aggressively cutting the country’s carbon emissions.

The pipeline, known as Keystone XL, is meant to help carry crude oil from the oil sands of Alberta to refineries on the Gulf of Mexico. The Obama administration blocked the project for environmental reasons — and in doing so, spared Mr. Trudeau from having to reckon with the consequences of building it.

Now, Mr. Trump has put Keystone XL back on the table, and with it the prospect of significantly increased oil production and carbon emissions, upending Canada’s climate calculus.

Mr. Trudeau has been trying to avoid taking the path of his father, Pierre Elliott Trudeau, whose energy policies as prime minister in the 1980s deeply soiled the family name among Albertans. The elder Mr. Trudeau imposed extra taxes and royalties along with price controls that angered the province’s oil industry. The younger Mr. Trudeau spoke up swiftly on Tuesday, welcoming Mr. Trump’s action. And the Canadian leader’s public support for the energy industry has helped him sell his national carbon-pricing program in the province — a program that polls strongly in areas away from the oil patch, especially Ontario and British Columbia.

But now people on all sides are angry at him. Along with a decision in late November to approve two other pipeline projects, Mr. Trudeau’s welcome of the Keystone XL revival has alienated many environmentalists in Canada, and has also strained his relations with some indigenous communities affected by the pipelines. And hours after Mr. Trump’s move was announced, Mr. Trudeau found himself in a heated public exchange in Calgary, Alberta, with a supporter of the oil sands.

“The federal government now has to be able to demonstrate that its climate plan is still relevant with increased oil-sands production,” said Simon Dyer, the regional director for Alberta at the Pembina Institute, an environmental group that accepts Mr. Trudeau’s argument that the oil sands are vital to the economy. “When you start to stack up the potential for increased production from increased pipeline capacity, it strains credibility that oil-sands emissions targets will be met.”

Dennis McConaghy, a former executive at TransCanada, the company that proposed Keystone XL, said he welcomed both Mr. Trump’s move and Mr. Trudeau’s endorsement of the project. But he agreed with Mr. Dyer that building the pipeline might make it impossible for the government to meet its emissions targets.

“The country needs to find a balance between a credible carbon policy and seizing this economic opportunity,” said Mr. McConaghy, who recently published a book on Keystone XL. “But on carbon, they have outlined commitments which will be very challenging to meet, especially given increased oil sands production.”

Mr. Trudeau’s cross-country tour of town-hall-style meetings this month has shown how tricky the balancing act can be.

When an attendee at a banquet hall in Peterborough, Ontario, challenged Mr. Trudeau on his earlier approval of the pipeline, he dived into his usual talk about Canada transitioning away from fossil fuels but still needing a vibrant energy industry. But then he veered slightly off script.

“You can’t make a choice between what’s good for the environment and what’s good for the economy,” Mr. Trudeau told the crowd. “We can’t shut down the oil sands tomorrow. We need to phase them out. We need to manage the transition off of our dependence on fossil fuels.”

That suggestion that Mr. Trudeau wanted to “phase out” the oil sands quickly attracted angry attention from conservative politicians and talk-radio hosts in Alberta, and the context — that he was defending the oil industry — was largely lost.

Mr. Trudeau’s road show arrived on Tuesday in Calgary, a stronghold of the opposition Conservative Party where his reception was never likely to be warm. His remark in Ontario was soon thrown back at him. A man wearing an “I Love Oil Sands” T-shirt and a “Make America Great Again” cap accused Mr. Trudeau of offering different messages about the energy industry in different parts of the country.

“You are either a liar or you’re confused,” the man told him. “And I’m beginning to think it’s both.”

The usually imperturbableMr. Trudeau raised his voice as he replied: “The responsibility of any Canadian prime minister is to get our resources to market and, yes, that includes our oil-sands fossil fuels.” Video of the exchange suggested that the crowd was divided about Mr. Trudeau’s position.

“There is a belief in the current government on the need to act on climate change,” said Tim Gray, the executive director of Environmental Defense Canada. “And they very much feel the way to do that was to get Alberta on side.”

Reviving the pipeline project will not help, he said. “The old-school model is still dominating the discussion in the country, and people have latched on to this idea that pipelines need to be built,” Mr. Gray said. “But the world is passing us by.”

Keystone XL was originally planned to enter service around 2012. Some analysts say the market has changed since then, to the point that there may no longer be a compelling business case for building it.

Oil production is quickly rebounding in the United States, threatening again to flood the domestic and international oil markets. Fuel prices at American pumps are relatively cheap without the pipeline.

If Keystone XL is built — and many hurdles remain — the pipeline would deliver up to 830,000 barrels of crude oil a day from Canada and North Dakota to Steele City, Neb., where it would enter an existing piping network bound for the gulf refineries. With the American market already oversupplied, most of the additional oil from Canada would probably have to be re-exported in refined form to foreign markets, or would replace American crude that would then be exported.

The project would create few permanent jobs, but it would generate thousands of short-term jobs in construction, which is why several powerful unions support the project.

“Keystone XL is just not a strategic artery anymore,” said Tom Kloza, the global head of energy analysis at Oil Price Information Service. “It’s not crucial to the circulation of North American crude oil. It’s become a focus of political partisanship, like the potted palm in the Jack Lemmon movie ‘Mister Roberts.’”

In the end, a completed Keystone XL pipeline may prove to be little more than a favor to Canada, where several American oil companies have made huge investments in the oil sands fields.

“In today’s world, the Canadians need the pipeline to get their oil to the world market,” said Philip K. Verleger Jr., an energy economist. “But it makes no difference to the United States.”