The headline is (I suspect deliberately) misleading. The actual guardian article is here [1] and is more nuanced, claiming that "One giant container ship can emit almost the same amount of cancer and asthma-causing chemicals as 50m cars, study finds". That's hardly "all the cars in the world", given that latest estimates put this figure at over 1 billion [2].
Ships produce more sulfur oxide pollutants than cars because they use different fuels, and thus produce different pollutants.
A large container ship does produce more more carbon dioxide emission per mile and per gallon of fuel than a car, but ships in general have the lowest emission levels of any other method of cargo transport , producing fewer emissions per ton of freight per mile than barges, trains or trucks.
[1] http://www.theguardian.com/environment/2009/apr/09/shipping-...