If even one state cannot certify their results the job of deciding who is president goes to the House of Representatives. If that happens Trump will win.
I was thinking that as well, but there's another remedy.
The state legislatures have the responsibility for selecting the electors for their state. We haven't always used popular vote elections to do that. Most states in the early years simply voted within the legislature and cast their electorals based on that. Therefore, if a state can't certify by the deadline, the Supreme Court could tell the state to hold a vote among legislators and substitute that result for the popular vote. Then they CAN certify, and the electoral college process will continue.
The kicker is the balance of power in PA, GA, MI, WI and AZ. The Legislatures in all of the swing states listed are a Republican majority. So, if the Supreme Court cancels the results of any of their elections, they can toss the election to the legislature and make them vote for the state's electoral slate.
That at least prevents the election from destroying the outcomes from states that didn't try to cheat.