The Russians declared war on Japan on August 9, 1945 (at 12.00am)
The second bomb was dropped on August 9, 1945 (at 8.30am)
Japan surrendered on August 15, 1945
Clearly from these dates, the atomic bombs played little to no role in Japan's surrender. If the second bomb played a key role in Japan's surrender, the date of Japan's surrender would've been sooner than August 15, 1945 (which was a whole 7 days after the second bomb was dropped). Japan surrendered specifically on August 15, 1945 because of Russia's declaration of war on Japan followed by Russia's occupation of Manchuria and subsequent collapse of Japan's Kwantung Army which numbered 1.2 million men, 5,300 artillery pieces, 1,150 tanks and 1,800 aircraft (in other words, the nucleus of what was left of Japan's Imperial Army). More than 600,000 soldiers of the Kwantung Army surrendered by August 15 leaving the entire region defenceless. The capitulation of Manchuria, total collapse of the Kwantung Army and threat of a Russian invasion on Japan itself was what convinced Japan to surrender.
With no navy, no air force, their armies being beaten by the Chinese, their people at home starving to death, American bombers ruling their skies, an effective American sea blockade in place, Russia declaring war on them, and with martial law imposed, Japan was essentially defeated by August 1945. This is why prominent US military commanders including Dwight Eisenhower, Douglas MacArthur, Chester Nimitz, William Leahy and Carl Spaatz were against the atomic bombs and a US invasion. They knew that both options were not needed when you look at Japan's situation. The atomic bombs were not militarily necessary to force Japan's unconditional surrender.
Truman dropped atomic bombs in a frantic attempt to end the war before Russia could rapidly acquire territory. Russia made a promise to the US at the Yalta Conference in 1943 (back when Roosevelt was President) that