I do wonder if destroying two major military bases instead might have done it.
It has been reported that the European city bombing stiffened the resolve if the survivors.
The destruction caused by a single atomic bomb in one instant versus the “familiar” conventional bombs no doubt altered the thinking of everyone.
Nagasaki and Hiroshima were legitimate military targets by any measure.
BTW...Japan itself engaged in indiscriminate bombing of civilian targets...