Numbers are interesting, but we all know what their roles are/were in T20is.
Imad opens the bowling and finishes his quota mostly in the first 10 while Afridi would bowl from 6-15th over. Afridi was a better wicket taking bowler while Imad contains the runs and any wicket he gets is sort of an added bonus atm.
Battingwise, Afridi has been the biggest hit or miss batter in history IMO due to his reckless batting, Imad is more of a proper middle order batter who has adapted his batting well as per his batting number(no.7 seldom gets to bat before 10th over)
In ODI's comparing their bowling is a bit easier, because Imad doesn't usually open the bowling unless it's in Asia. Here again, Imad does a containing job, AND HE DOESNT get any wickets, which is a big big problem if he's your main spinner. Afridi on the other hand, would take wickets while going for around 40-48 runs per match but would take 1 or 2 wickets and in his peak he would take a lot of 4fers and 5 fers.
Imad certainly needs to develop his leftward spinner (left armer's offbreak) if he's to become a wicket taking bowler.
Battingwise here, Afridi apart from a brief period in 2005 and 2010, was never ever a consistent batter to be taken seriously as a batter. And Imad is starting to get better in that discipline (or he looks to be doing that), but we shall see how it goes.
In short, Afridi is one of the ATG T20i players who are extremely hard to replace but Imad is doing a commendable job in whatever role he is asked to do.
In ODI's, even at his worst, Afridi was arguably a better bowler than Imad, but then Imad is a better batter(atleast skills and temperament wise apart from brief spells of consistency from Afridi) and should look to translate that into his performances.