But the amendment’s defeat, without a vote tallied, was a setback for a core Republican principle, and it played out in public on the Senate floor, underscoring just how far most congressional Republicans would go to avoid confronting Mr. Trump ahead of the November midterm elections. The increasingly lonely forces of opposition within the party are coming from those who are leaving politics or those in the chattering classes safely removed from a Republican electorate overwhelmingly aligned with the president.

“There’s no question that leadership in general is wary of doing anything that might upset the president,” Mr. Corker said on Wednesday, describing his party’s following of Mr. Trump as “cultish.”

Other Republicans were equally deflated on Wednesday, but the path forward was not clear. Senator Mitch McConnell of Kentucky, the majority leader, is reluctant to put forward legislation that Mr. Trump does not support because he does not want to waste time making Republican senators take difficult votes ahead of a possible veto.

“It’s terribly disappointing,” said Senator Patrick J. Toomey, Republican of Pennsylvania, who helped write the Corker trade amendment. He added: “We are the Senate. We’re not potted plants. We should be doing what we think is right.”

Douglas Holtz-Eakin, the former director of the Congressional Budget Office and president of the conservative American Action Forum, said the Republican trade rebellion collapsed because the party is genuinely divided on the issue these days — and laying bare those divisions would not help Republican election prospects. The fear of a seething presidential tweet has left some in the party paralyzed.