If you consider just the overall averages excluding Bangladesh and Zimbabwe, there's only a couple of points in it in their overall average.
Ajmal: 53 innings, 140 wickets@28.19 with 8 fivers
Herath : 87 innings, 212 wickets@30.98 with 16 fivers
Ajmal's got a ten for more but 6/8 fivers against these sides have come in losses; clearly not a match winner
Herath has played more vs the likes of Australia (8 tests vs 1) and has played vs India/in India as well(against a rampant Sehwag and an Indian line up in top form) whereas Ajmal has never played India.
Have a look at it country by country.
Vs Aus - Ajmal 111.50, just one match;
Herath 29.92
vs Eng -
Ajmal 19.61, Herath 30.03
Vs NZ - Ajmal 58.50, just one match;
Herath 19.58
vs SA - Ajmal 32.53,
Herath 27.72
Vs WI -
Ajmal 14.47, Herath 43.50
It is far from clear cut tbh, if anything you could argue Ajmal has benefited from not playing the likes of Australia more. Away from home is a similar story and there's hardly anything meaningful there...Ajmal has played just 1 match in Australia in which he was pretty horrible. While 1 match means nothing, Herath had a decent series there last time. In SA, Herath was better and Ajmal better in England. Aside from that, Herath has played India in India and I can bet Ajmal would have been tonked by
that line-up as well. There's nothing else to go on really. You could point to Ajmal's 2 games in WI but WI are a terrible batting side these days and Herath's solitary test in WI was before Ajmal even made his debut so I'm not sure how much you can read into that. In any case if we're including that, might as well include their solitary tests in NZ(years apart I may add) in which Herath was better.
Personally, I would have Herath more often than not. Maybe I'd take Ajmal on a rank turner against players who are suspect against spin bowling; but otherwise give me Herath any day of the week and twice on a Sunday.