PORTLAND, Me. — Facing urgent calls to stabilize his candidacy and declining poll numbers, Donald J. Trump struggled on Thursday to refocus his message after threatening to withhold his endorsement from top Republican officeholders, including Paul D. Ryan, the speaker of the House.

Snarling Mr. Trump’s efforts to move past the controversy, he and his running mate, Gov. Mike Pence of Indiana, broke ranks for the second time in two days on questions of party unity. Having already split with Mr. Trump over his refusal to endorse Mr. Ryan, Mr. Pence went his own way again Thursday, telling WTKR, a television news station in Norfolk, Va., that he supported senators running for re-election whom Mr. Trump had snubbed, John McCain of Arizona and Kelly Ayotte of New Hampshire.

Mr. Pence at first gave an equivocal answer on Thursday regarding the senators. But when asked by the television station to clarify whether he supported them, he said, “Well of course I support John McCain and Kelly Ayotte and all of our Republican incumbents.”

In his own travels, Mr. Trump was frustrated in his effort to go back on the offensive with an audacious foray into Maine, a solidly Democratic state in presidential elections.