Based on the long history of trying to price in externalities, bans are probably more effective. Just look at how many games are played with carbon "credits", and how little real impact they've had.
On the other hand China didn't ban petrol but has heavy incentives for electric and is now at about 50% EVs, similarly Norway is at about 90%. Not exactly pricing the externalities but it kind of works. Like in China I think if you want a vehicle you need a permit and can get one straight away for EVs but have to wait 8 years for petrol or something like that.