I wouldn't be too sure about that. Most electricity is still generated by burning fossil fuels. Solar and wind have increased in recent years but still have a very long way to go. We may just be relocating the engines rather than decarbonizing.
(See also, New York City banning gas lines to new construction, requiring the use of electricity for heating and cooking, just after the metro area's sole nuclear plant was decommissioned and new gas plants were built to replace it... so the ban is not going to reduce the amount of gas burned at all, is it?)