One official with the United Steelworkers said his Pittsburgh-based union had urged members to back Mrs. Clinton, but many preferred Mr. Trump, largely because of his tough talk on trade with Mexico and China. Many lapped up his promises to bring back manufacturing jobs, hinting at a return (an improbable one) to the 1950s and ’60s, when manufacturing boomed and unions were mighty. (Mr. Trump’s G.O.P. allies are spoiling, however, to further hobble labor unions, which are far weaker than in the ’60s.)

Many steelworkers, the official explained, disliked Mrs. Clinton because of her ties to Wall Street, because her husband had championed Nafta and because she had supported the Trans-Pacific Partnership before coming out against the trade pact during the campaign.

Leo Gerard, the steelworkers’ president, sent a letter to his union’s 600,000 members, acknowledging that its ranks “were divided this election season.” While the economy has grown, he wrote, “the growth has failed to stimulate the manufacturing sector because of our nation’s failed trade policies.” Maintaining that Mr. Trump had appropriated his union’s message, he wrote, “Trump used our own words to speak to these problems, and to the real suffering, fears and anxieties that so many feel.”

Most labor leaders viewed Mr. Trump far more harshly than his union backers did; they often attacked him as a con artist and a threat to unions and workers. Mrs. Clinton would have prevailed had she adopted a more muscular pro-worker message, union leaders lament, more like Bernie Sanders’s message attacking trade deals and inequality.

With Mr. Trump’s victory and with Republicans now controlling both houses of Congress, unions are expecting a series of stinging blows. Even as Mr. Trump talks of spending $1 trillion to improve infrastructure, many Republicans are eager to repeal an 85-year-old law requiring that contractors pay union-level wages on federal projects. Congressional Republicans are likely to take up nationwide “right-to-work” legislation, which would sap union treasuries by barring any requirement that workers pay union dues or fees. And even if Senate Democrats manage to block such a law, Republican gains in Kentucky and Missouri mean those states are likely to enact their own right-to-work laws.