Even if we could mandate all-electric tomorrow, it wouldn't make sense or be feasible for quite a while...
At the moment there's neither the capacity (or materials available atm) to make enough batteries, nor the infrastructure in eletry production, delivery, and charging, nor the money lying around to buy them (outside the West), to replace the 1 billion cars all around the world in any short timespan (say 20 years)...