Beijing’s announcement that it is considering joining France and Britain in banning petrol and diesel cars from its smog-clogged roads promises to accelerate a push towards electric vehicles—a race in which Chinese carmakers have everything to gain.