They were already looking for ways to surrender before that – just not unconditionally. They knew they were beat. The real sticking point was that the Japanese effectively wanted guarantees the US wouldn't just put Hirohito before a firing squad. Agree to that, and the US + allies could have had capitulation on terms well before the nukes.Without the atomic bombings of Hiroshima and Nagasaki the Japanese would not have surrendered. They would have likely fought till Japan itself was conquered in a ground invasion. Therefore the obvious answer to your question is the United States defeated Japan.