The Japanese had demonstrated that they would fight fanatically and generally fought until annihilated.The US had suffered huge casualties invading Iwo Jima and Okinawa. The Japanese army still had considerable strength within Japan proper. There is no hard evidence that Japan was willing to unconditionally surrender. The atomic bomb offered American leaders the option to annihilate Japan without suffering huge additional casualties. Most veterans idolized Truman for dropping those bombs which made a costly invasion of Japan proper unnecessary.
In terms of lost lives, there were plenty of other bombings in World War 2 that were more costly than the bombs dropped in Hiroshima and Nagasaki.
The firebombing of Tokyo was one of those.
So I think the shock effect of the devastation just one bomb could do is what shook the Emperor and other military leaders to surrender.