Ok,onto why hannibal is rated higher than scipio.
First u need to understand the difference in quality between the roman infantry and carthiginian infantry,the basic roman infantry was usually far better armoured than its carthiginian counterpart and likely to win an engagement against it or any ancient age soldiers at that time as proved by the easy roman victories at magnesia and pydna vs the famed seleucid and macedonian forces,the 2 superpowers of the age just after the punic wars.The roman use of the aces triplex [triple line chequerboard formation]also gave them a key advantage in infantry encounters.
Now what hannibal understood was that in a straight fight he couldn't beat the roman infantry,he correctly deduced his marginal superiority in cavalry was his true advantage.Keep in mind though that this was before the age of the stirrups so cavalry had not yet become THE most important factor in battle,it remained a potent mobile support arm.
Hannibal's campaign in italy is simply amazing considering the odds facing him.First he crossed the alps ,a inhuman logistical feat in those times.Then totally outnumbered defeats the romans in 3 great tactical masterpieces.
Cannae the third battle is considered more or less unanimously as 'the GREATEST tactical battle' of all time and all commanders since from napoleon,to the germans wanted to emulate it.
He made cavalry the central piece of his victory.This enabld him to despite being terribly outnumbered.
Scipio was a survivor of cannae and observed these tactics,later he invaded spain and conducted a brilliant campaign against the other carthiginian commanders there.
Meanwhile in italy the romans had invented fabian tactics..basically never to give hannibal open battle but forever shadow him.
This worked because hannibal had no siege engines and these and reinforcements were denied to him by the carthiginian governement back home.
It is a testament to his skill that he roamed freely in italy for 17 yrs without the romans ever challenging him in a major battle.
Now onto zama...the main basis for scipio being greater than hannibal.
At zama....hannibal had only 25% of his veteran army of italy,the others had been left behind in italy for the lack of transports.Scipio's infantry are veterans of the spanish campaign...and the regular roman infantry is superior to the carthiginians.
Hannibal's great strength in all his early battle sis missing,he is outnumbered in cavalry.The famed numidian cavalry that fought for the carthiginians now switches sides and joins the romans.The war elephants are a novelty and fail.
Even under these conditions the two infantry forces are stalemated until scipio's cavalry defeats the inferior carthiginian cavalry and strikes from the rear defeating the carthiginians.
Basically scipio took hannibal's tactics and used it on him.He also had all the advantages going into the battle.If hannibal had superiority in cavalry it was probably going to be a a different story.
Ultimately when asked who was the greatest general of the age scipio said it was hannibal.
So i would say they are neck and neck but hannibal is still slightly ahead.That's the view held by most military experts,and great commanders like caesar and napoleon as well..which is why hannibal is called the 'father of strategy'.
IF u want to understand more in depth....see the battle maps and best the animated battle maps in youtube showing u step by step progression of the battles.Trebia,trasimene,cannae.
And illipa,metauras,zama.