I recently saw a program on history channal where three brothers follow the path of Hannibal during the second punic war, which routes he took, where his battles was and they mentioned the substansial losses the Roman army took.
During Hannibal's years of harrassing Rome he had killed around 100 000 Roman soldiers. Yet Scipio amelianus manages to make a counter offensive in Africa on Chartaginian land. However could Rome survive such losses yet go on the offensive!?
Scipio attacking Carthaginian territory in Africa was mostly a case of the best defense being a good offence. The Romans had basically been unable to chase Hannibal out of Italy for 15 years so they tried a counteroffensive to get Hannibal to return home to defend Africa and it worked.
In terms of making up for losses, the Romans had a very deep pool of available manpower between Rome and all their Italian Allies and they were absolutely relentless in their conduct of the war. Most of the allies stayed loyal to Rome and provided that reserve of manpower. Even so Rome had to widen the age range of military service as well as even raise legions of slaves who were promised their freedom in order to make up their losses.
Remember that during the Second Punic War, Rome was fighting on three separate fronts. In Spain, in nothern Greece and in Italy itself.