Any rational government in Japan's position would have surrendered after the fall of the Mariannas. You just didn't need to be Albert Einstein to figure it out at that point.
Damnedest thing, though, is that they didn't surrender after that fall.
With respect to winning and losing, for the winner it might not be that important afterwards, but for the loser the only hope of success was to win when it was possible.
Losers don't care if they win or lose.
Even after Hirohito had put his foot down and decided to surrender, there were some rogue elements who wanted to assassinate him and keep fighting.