This is why ebikes produce less CO2 per mile than regular bikes. Even if you're getting your electricity from coal, battery and motor efficiency are so much higher than food digestion and muscle movement.
The ebike starts life from the factory with a higher CO2 cost, though, and it never quite catches up over its expected life.
Both are orders of magnitude lower CO2 than a car (both production cost and per mile cost). The lifetime CO2 cost of an ebike vs normal bike is so small, and the gulf between either of those and a car is so big, that anyone pointing to this in favor of cars is an idiot. If an ebike is what gets you to bike more, do it. Any movement from cars and onto bikes is a huge win, battery or not.