A watt hour is equal to 0.86 nutritional calories. My estimate of 40 watt hours per mile converts to about 35 kcal. Estimates of the energy taken to pedal a bike are about 30-40 kcal/mile. That checks out!
1 kilowatt hour is equivalent to 860 kcal.
1 kilowatt hour from a coal power plant generates about 1.0-1.1 kg of CO2.
For a typical Western diet, studies suggest that the average emissions associated with food production and transportation can range from about 0.5 to 2.5 kg of CO2 per 1,000 kcal of food consumed. (0.4-2.1 kg of CO2 per 860 kcal)
The ebike generally has a smaller environmental footprint than the analog bike, as most sources of power produce less CO2 than coal power plants and most people eat more meat than necessary, putting them in the higher range of the food CO2 production range.
Riding a short distance vs riding a long distance is irrelevant. Both systems require an amount of energy per unit of distance. Because the energy is supplied in different ways, there is a different amount of carbon emitted of per unit of energy.
Here's a source, dickface: https://www.ebikes.ca/documents/Ebike_Energy.pdf