The indisputable fact is that Japan had thoroughly lost the war at that point--it was either losing or had already completely lost in every theater. I tend to think that the atomic bombs played a big role in the decision to surrender in that it showed that the Americans were capable of devastating entire cities with a single bomber: air defenses are unlikely to score any hits against a single bomber unlike a large fleet of bombers carpet bombing cities into oblivion, robbing Japan even of the chance to die in a blaze of glory.
But this also raises a tricky moral question. The decision to end a war is not made by the victor but by the loser. What should you do if the loser refuses to admit the loss?