Trump Could Still Lose
The election is not over until the Electors vote.
Courts have ruled that while states can require Electors to take a pledge of loyalty, Electors of the Electoral College are free agents. Electors breaking their pledge or refusing to vote is not unheard of (the term for such an Elector is a Faithless Elector https://en.m.wikipedia.org/wiki/Faithless_elector).
The entire commonwealth of Virginia delegation refused to vote for a Vice Presidential candidate in 1836 because of the candidate's admitted relationship with a slave (the election was thrown to the Senate, and they eventually voted the VP into office). There are several instances of Faithless Electors in modern history, but none that put the election in doubt by placing the candidate below the 270 electoral votes needed to win.
While the chances are remote, there could be an elector revolt in any Presidential election. If one accepts the premise that the electoral college was designed to ensure the public made rational choices, they might decide to withhold votes for Trump, therefore casting the presidential election into the House of Representatives. (Or the Senate, in the case of the Vice President, because electors vote for each position independently).
Once the election goes to the House and/or Senate, those bodies can vote for anyone they want. In that case, we'd probably have a Paul Ryan presidency instead of Donald Trump.
It would be an unprecedented move. But it's been an unprecedented election year.