But beyond policy disappointments, Mr. Ryan used his final moments as speaker to point to the deeply corrosive nature of politics in the age of Mr. Trump, effectively diagnosing the forces that weakened him and ultimately led a man once viewed as the party’s future to retire from one of the most powerful posts in Washington at the age of 48.

Mr. Ryan never spoke Mr. Trump’s name — although he made a late edit to his remarks to add a single mention of “the president and the vice president, who became my partners in government” — but his speech was a stinging indictment of Mr. Trump’s breed of politics.

“Outrage has become a brand and, as with anything that gets marketed, it gets scaled up,” Mr. Ryan said. “It is just emotional pabulum fed from a trough of outrage. It’s exhausting. It saps meaning from politics, and it discourages good people from pursuing public service.”

He might have been talking about himself.

Mr. Ryan’s speech was part of an elaborate valedictory tour that he and his staff have undertaken in recent weeks, including a six-part online video series documenting his career-long quest to enact tax cuts. It is meant to burnish his image as he leaves Congress, the improbable final chapter — at least for now — of a meteoric ascent in Republican politics that stalled unmistakably with the rise of Mr. Trump and his anti-establishment fervor.

Intentionally or not, it served to highlight, in the waning hours of all-Republican rule on Capitol Hill, how the party has changed since Mr. Ryan — a proud member of the Republican establishment, known for his zeal for overhauling entitlements — was viewed as one of its most promising rising stars. With Mr. Trump in the White House, Mr. Ryan’s strain of Republicanism is seen as a liability and an object of disdain from the party’s ultraconservative base, which prizes partisan battling over governing and regards legislative negotiating as weak capitulation.