And the forces do seem aligned against the pact’s approval.

Months ago, Senator Mitch McConnell of Kentucky, the majority leader who is pro-trade but worried about keeping Republican seats, ruled out a vote before the election. The so-called T.P.P. would phase out thousands of tariffs, open markets and impose new trade rules, including for labor rights and environmental standards, on signatory nations that span both sides of the Pacific, including Japan, Vietnam, Australia, Canada, Chile and Mexico.

And Mrs. Clinton appears to have put her finger on the scale against a vote in the lame-duck session. Asked by an anti-T.P.P. group if she would oppose a lame-duck vote on the accord if elected, Mrs. Clinton responded, “I have said I oppose the T.P.P. agreement — and that means before and after the election.”

Representative Sander Levin of Michigan, House Democrats’ point person on trade, was blunt. “T.P.P. cannot pass this session as negotiated,” he said.

“There were always major problems as they negotiated it,” he added, “so I don’t want people to think it’s simply because of the presidential race.”

Indeed, Mr. Obama acknowledged he faced an uphill push when the agreement, in the works since the George W. Bush administration, was announced in October. The hostility toward trade agreements has built over decades as manufacturing jobs shifted overseas and middle-income wages stagnated.

Those politics have only grown more toxic, stoked by anti-trade blasts from Mr. Trump in the Republicans’ nomination contest and Mr. Sanders in his challenge to the Democrats’ front-runner, Mrs. Clinton. Pressured by Mr. Sanders, Mrs. Clinton turned on the agreement she had praised as the “gold standard” during negotiations.

Not since the Depression has a Republican nominee opposed free trade and favored high tariffs on imports, but Mr. Trump’s hard line potentially threatens Mrs. Clinton’s support in manufacturing states. He has called the Pacific agreement “the biggest betrayal in a long line of betrayals where politicians have sold out U.S. workers” — a stance that separates him from the Republican Party’s highest-ranking elected official, pro-trade Speaker Paul D. Ryan of Wisconsin, who so far has declined to endorse Mr. Trump.

Mrs. Clinton, by her stand, has forsaken the New Democrat trade legacy that her husband as president and now Mr. Obama forged for their less-than-receptive party by introducing labor, human rights and environmental protections into trade agreements.

Trade supporters have long counted on action in a lame-duck Congress. But they did not count on Mr. Trump being the nominee. His election could likely doom the accord, T.P.P. advocates concede, by dissuading Republican leaders from advancing an issue their party’s standard-bearer so opposes. But some Republicans do not rule out a vote, because, they say, the deal deserves consideration or because Mr. Trump will not be elected.

Even a lame-duck strategy necessitates some action before the election.Under the terms of trade legislation that helped Mr. Obama complete the accord, Congress must hold public hearings on the agreement before it is voted on, and a lame-duck session would not provide enough time for committee action and House and Senate debates.

Mr. Obama, in Vietnam recently, predicted that Congress would ratify the accord. A big reason for administration confidence is that Congress a year ago narrowly voted to give the president so-called trade-promotion authority, which puts T.P.P. on a legislative fast track, ruling out amendments and requiring just 51 votes in the Senate, not 60.

And with T.P.P. in hand, supporters are pointing to potential gains for American exporters. “We think there’s some opportunity to pick up some people, given the specific benefits to their districts,” Mr. Froman said.

For example, supporters hope the strong backing of beef producers and other agriculture groups will hold down defections among House Republicans in rural districts who fear Mr. Trump’s backlash.

“T.P.P. is going to take our tariff rate from 38½ percent to 9 percent” for American beef sold in Japan, said Kent Bacus, director of international trade for the National Cattlemen’s Beef Association. That would erase Australia’s advantage in Japan since the two nations reached a separate trade agreement last year, costing American exporters roughly $300 million in market share.

Agriculture groups will hold pro-T.P.P. events in lawmakers’ districts this summer, Mr. Bacus said. “They’re going to listen to their constituents. We’re not going away,” he said.

Mr. Froman for months has been meeting with lawmakers to address their complaints and with other nations’ trade ministers, to goad their countries to act on their T.P.P. commitments now – on labor rights, for example – so that he can reassure Congress’s doubters.

Mexico’s president recently sent legislation to his Congress that would address American complaints about its restrictions on unions. Such reforms have been a priority of Senator Ron Wyden of Oregon, the pro-trade lead Democrat on the Senate Finance Committee responsible for T.P.P., although they are unlikely to satisfy most American unions.

Just last week, the administration, the financial services industry and its backers in Congress settled on a policy addressing other nations’ requirements for local storage of companies’ financial data abroad. The administration also has allayed concerns among dairy groups and among pork producers concerned about new subsidies in Japan for its industry.

That leaves one main issue to settle, supporters say, over provisions reducing American pharmaceutical companies’ monopoly control of advanced drugs known as biologics. The industry opposes the change and has a prime ally: Senator Orrin G. Hatch, Republican of Utah and chairman of the Finance Committee.

In a statement, Mr. Hatch said, “If the president wants T.P.P. to be approved, he will need to work with Congress to address concerns. I’m hopeful that, at the end of the day, I, along with many of my colleagues, will be able to support a strong T.P.P.”

His House counterpart, Representative Kevin Brady, Republican of Texas and chairman of the Ways and Means Committee, in a statement extolled the agreement. But he said he would “continue to work with the administration to resolve members’ outstanding concerns.”