There is no evidence suggesting that the American leadership believed that a total surrender was imminent. We have evidence that the cabinet was deadlocked substantially over the decision to keep fighting, and that the twin shocks of the atomic bombings and Soviet attack broke this deadlock. After the decision was made, a military coup was attempted to try and reverse the decision. If you believe you're capable of disentangling the significance of the two simultaneous events, then you should present your findings to a historical journal, because the current consensus is something like "lol dunno, both important but don't know which was more important".
Even if there was evidence that America knew peace might happen in August, the decision to drop the bombs had been made prior to the event. Authority over the precise dates were delegated to forces on the ground based on their judgement and prevailing weather conditions. The morning of the bombing, Truman was not called up and asked to push a red button or anything like that. It was a signed order, which filtered down to people on the ground who had to actually do the dropping.
They were going to just keep dropping bombs as soon as they could ship them. And why wouldn't they? They'd been annihilating every scrap of industry they could find from the air for over a year at this point. Setting fire to cities, hitting populated areas, the lot of it. That's what WWII was. The Japanese had bombed China, the Germans had bombed Britain, the British had bombed Germany, and when America got involved they bombed every enemy country they could. They had control of the skies over Japan, just like they had Germany, and they were going to bomb Japan to suppress it's industry, military bases and everything near them (because you couldn't accurately bomb anything with the technology of the day) until the forces were prepared for a ground invasion or the Japanese surrendered of their own accord.
I would generally agree that the decision to drop them was not done on humanitarian grounds, but neither was it done on cynical ones. The idea of the atomic bombings as a special case has taken root firmly in the psyche of the modern world, in small part because it is a single visceral that it is easy to understand the horror of, and in part because of a firm understanding of what came next historically, the atomic age, the cold war, the spectre of nuclear annihilation hanging over the whole world.
"Atomic Bomb" vs "Invasion" was not a decision that Truman or his predecessor faced. The actual decision was "Atomic Bomb, yes or no?" The plan was to use atomic bombs, in addition to mass conventional bombing raids, more or less as they could, and then to invade when forces were in the field. And the government did believe they would need to invade. They made active preparations to do so. The government clearly
hoped that the bombs would force a capitulation, but they were not betting the farm on it, they had every contingency covered.