It's a similar situation to reducing the CO emissions of cars, meaning you produce more CO^2^.
When the health benefits outweigh the costs (and ideally, allow us to work on reducing the fossil fuel used altogether), it comes out as a net positive.
And as we've seen with cars, improving efficiency has offset the increases with time.
And not to mention that the bulk of the emissions happen when ships are in international waters, and burning bunker oil.