The short answer is the transition will take many decades to effect, given the magnitude of the materials involved just in the electric car supply chain—never mind the other green machines. It's just the electric car side. Any serious analysis sees this as taking many decades—not one or two.
Given the state of the world today and what we know now about where these minerals are produced.... Most cobalt is in the Democratic Republic of Congo, while 90% of all cobalt refining in the world is in China on a grid that's 60% coal-fired. The majority of the world's neodymium is refined in China on a coal-fired grid.
If you do the accounting properly, we have to be honest. We don't really know what the emissions are upstream in many cases, because the mines in countries don't co-operate—and are not required to—to tell how they do their processes.
For those estimates—and there are estimates—you can reasonably conclude that there's no net change. In fact, in some cases there's even an increase in global CO2 emissions associated with the nature of the process we have today to replace an internal combustion engine with a battery-powered vehicle.
Again, this is not a policy statement or a political desire one way or the other. These are just the physical facts of the processes that exist.