If Russia nuked Ukraine they might win the war on Ukraine, sure. Japan didn't even quit until there were two though. Would they have quit with no nukes and just firebombing?
The US may just as well have dropped 10 more nukes and it wouldn't have changed anything. The Japanese didn't care whether it took a 1.000 bombs to destroy a city or a single one. Even more so, since they didn't know anything about the radioactive fallout and long-term effects. To them, it was just a bigger bomb.