JOHNSON CITY, Tenn. — President Trump trained his sights on three leading Democratic prospects who could face him in his 2020 re-election battle, at a rally Monday evening that was ostensibly aimed at helping Tennessee Republicans facing a tough climate in the midterm elections.

Over 59 minutes, Mr. Trump veered on and off the remarks on his teleprompter as he defended Brett M. Kavanaugh, his embattled Supreme Court nominee, whom he said Democrats were “trying to destroy.” He implored people to vote in the midterm elections in five weeks. He rattled off a list of his accomplishments, before putting the list aside to avoid boring his crowd.

But Mr. Trump, in the first of four campaign rallies he will hold across the country this week, appeared to have his own re-election on his mind.

Mr. Trump, who defeated 17 major candidates in the primaries and the general election in 2016 by savaging them, road-tested a series of aggressive attack lines against some of the top 2020 prospects — former Vice President Joseph R. Biden Jr., Senator Elizabeth Warren of Massachusetts and Senator Cory Booker of New Jersey.