With the retirement of Speaker Paul D. Ryan of Wisconsin at the end of the year, Republicans face their own fight for control. The embarrassing rout of “compromise” immigration legislation last month resurfaced concerns that Mr. Ryan’s power may be waning. And while the party has a clearer order of succession, it remains to be seen if Representative Kevin McCarthy of California, the majority leader, can consolidate the support to replace Mr. Ryan.

One potential challenger, Representative Jim Jordan of Ohio, fell under a cloud last week with the emergence of allegations that he knew about and did not act on accusations of sexual abuse when he was a wrestling coach at Ohio State University. Another, Representative Steve Scalise of Louisiana, appears to be mounting a public relations campaign ahead of the release of his book, just days after the election, chronicling his arduous recovery after he was shot at a Republican congressional baseball practice.

Both struggles are playing out against the backdrop of November’s elections, in which control of the House could tip to the Democrats for the first time in nearly a decade.

And hanging over it all is President Trump, who has reshaped both parties, moving them toward the political poles even as he fortifies a hunger for tougher leadership. Some Democrats are demanding brash torchbearers to beat back “Trumpism” and counterpunch hard when the president lashes out. Republicans appear ready to embrace the person most unabashedly allied with Mr. Trump. A scandal like Mr. Jordan’s once could have forced a quick resignation, but his relentless defense of the president has buttressed his resilience.

“It’s hard to recall when there’s been a moment where both parties have done so much head-scratching and soul-searching about what their respective futures should be,” said Doug Heye, who served as a top aide to former Representative Eric Cantor, Republican of Virginia, when he was majority leader.