Trump just needs to drag out the certification of results for another few weeks in order to make it hard to certify in time. At which point the state legislatures (Republican dominated), can use this to directly choose electors who will vote for Trump even if their electorate voted otherwise.
Failing that, if it pushes out past Safe Harbor day, and continuing litigation means that states aren't represented due to being unable to certify their results in time; or if the validity of those electors can be challenged due to being instated after the Safe Harbor day, then the consitution throws the choice of president to the House of Reps.
You might then say "But Democrats have a majority even after losing seats in the House of Reps" and wonder how that could work in Trump's favour. But the Constitution announces a special voting rule when it comes to the House voting on the President; each state's congressional delegation gets only one vote. There are twenty six states with Republican majority in their current house delegations, and they may even gain more.
It would be a mistake to think that the litigation winning on its own merits has anything to do with Trump potentially seeing a consecutive term.