They sent one legion of indeterminate quality to Greece, where it played a secondary role to the forces of the Aitolian
koinon in the war against the Makedonians. It was an excellent investment, almost regardless of the outcome. The
demonstration of support arguably kept the Aitolians in the war against Philippos, who had shown that he was willing to dispatch troops to support Hannibal against Rome if he had the opportunity to do so. With the Aitolians in the fight, Philippos had less of a margin for error in sending troops to Italy, and ultimately was unable to get Hannibal the support he had wanted to give. So the choice, as the Romans saw it, was either to send a single legion to Greece, or to have that legion in Italy, but also have to fight against many, many more Makedonians in Italy as well. This is an easy choice to make, regardless of how attenuated Roman manpower was.
You're also overstating the extent to which Rome was even abandonable in the first place. The Republic was not a modern nation-state. It wasn't as though the conscript fathers could simply leave the capital for anywhere else in the country, like a French government fleeing to Bordeaux or something. Rome's republic was basically Rome itself, tied by alliance and various levels of colonial and associate citizenship to the rest of the cities of Italy. Outside of Rome, the Senate had no direct legal authority. Without Rome, it lacked the force to back up its treaties with the rest of Italy. Fundamentally, if the conscript fathers abandoned Rome, they would be abandoning their basis of both legal legitimacy and military power. They could not do this and conduct a partisan campaign in the countryside of Italy, because without Rome, the Italians would rightly see the Roman Senate as powerless and refuse to sustain their bankrupt cause.
So the Romans may well have still had armies in the field if Hannibal managed to occupy the place. It wouldn't matter. The Senate would almost certainly not have abandoned Rome with a united front, and I imagine most, if not all, senators would not have abandoned Rome at all. Permitting the Qarthadastim to destroy the city, and virtually all their property and belongings, would be far beyond the pale even for the notoriously bloodthirsty conscript fathers. If they had, they would not be able to sustain a partisan campaign against Hannibal. A third of Italy abandoned Rome after Cannae; imagine how much of Italy would abandon Rome if the city itself fell.
I have no idea why you're bringing up Japan there. It's, like, a total
non sequitur. And I have especially no idea why you're referring to Japan as an adaptable society in a military context when the history of the Imperial Japanese Army at war is one of a military that repeatedly tried to adapt the battlefield, the government, the Japanese people, and international politics to its own precepts, and failed miserably every time.
Furthermore, the notion that Hannibal's army was somehow vulnerable to breakup is somewhat laughable. Hannibal was objectively losing for the entire last quarter of the war. Yet his army remained intact and fanatically loyal. He could bring Italians, Greeks, Celts, and Iberians to the fight at Zama in North Africa in 202, long after the Romans had chased him out of Italy and landed an army on the doorstep of Qarthadast. Hannibal's army was, in fact, almost objectively superior in quality to Scipio's, especially in terms of infantry. Scipio narrowly managed to outgeneral him, and the return of Massinissa's cavalry at the end of the battle rescued the Roman army from what was rapidly threatening to become a rout.
EDIT: Exactly what FP said, except in too many words.