In fact the war was lost by Japan, but Japan was unable to acknowledge that.
The use of the first atomic bombs saved many lives, Japanese civil ones mainly.
The battle was the bloodiest in the Pacific, with approximately 160,000 military casualties combined: at least 50,000 Allied and 84,166–117,000 Japanese, including drafted Okinawans wearing Japanese uniforms. According to local authorities, at least 149,425 Okinawan people were killed, died by suicide or went missing, roughly half of the estimated pre-war population of about 300,000.
Imagine the costs of an invasion of Japan !!!
[Battle of Okinawa - Wikipedia]
On 7 August, a day after Hiroshima was destroyed, Dr. Yoshio Nishina and other atomic physicists arrived at the city, and carefully examined the damage. They then went back to Tokyo and told the cabinet that Hiroshima was indeed destroyed by a nuclear weapon. Admiral Soemu Toyoda, the Chief of the Naval General Staff, estimated that no more than one or two additional bombs could be readied, so they decided to endure the remaining attacks, acknowledging “there would be more destruction but the war would go on”. American Magic codebreakers intercepted the cabinet’s messages.
[Atomic bombings of Hiroshima and Nagasaki - Wikipedia]
In fact, the A bomb saved hundred of thousands ofJapanese and US lives.
Japanese leaders were fanatics. They had to be removed from power.
Until 9 August, Japan's war council still insisted on its four conditions for surrender. The full cabinet met at 14:30 on 9 August, and spent most of the day debating surrender. Anami conceded that victory was unlikely, but argued in favor of continuing the war nonetheless. The meeting ended at 17:30, with no decision having been reached. Suzuki went to the palace to report on the outcome of the meeting, where he met with Kōichi Kido, the Lord Keeper of the Privy Seal of Japan. Kido informed him that the emperor had agreed to hold an imperial conference, and gave a strong indication that the emperor would consent to surrender on condition that kokutai be preserved. A second cabinet meeting was held at 18:00. Only four ministers supported Anami's position of adhering to the four conditions, but since cabinet decisions had to be unanimous, no decision was reached before it ended at 22:00.
Calling an imperial conference required the signatures of the prime minister and the two service chiefs, but the Chief Cabinet Secretary Hisatsune Sakomizu had already obtained signatures from Toyoda and General Yoshijirō Umezu in advance, and he reneged on his promise to inform them if a meeting was to be held. The meeting commenced at 23:50. No consensus had emerged by 02:00 on 10 August, but the emperor gave his “sacred decision”, authorizing the Foreign Minister, Shigenori Tōgō, to notify the Allies that Japan would accept their terms on one condition, that the declaration “does not comprise any demand which prejudices the prerogatives of His Majesty as a Sovereign ruler.”
On 12 August, the Emperor informed the imperial family of his decision to surrender. One of his uncles, Prince Asaka, then asked whether the war would be continued if the kokutai could not be preserved. Hirohito simply replied, “Of course.” As the Allied terms seemed to leave intact the principle of the preservation of the Throne, Hirohito recorded on 14 August his capitulation announcement which was broadcast to the Japanese nation the next day despite a short rebellion by militarists opposed to the surrender.