from a raw source (be it wind, oil, coal, sun, wood ect.) with a ICE your a taking the raw materials and running through the entire energy generation process.
You had better be more efficient since half the steps are already done, this is apples to oranges.
Take a modern day locomitive for example we call the diesel locomotives, they are actually electric run by diesel generators, you dont ignore the cost of the electricity generation when considering how cheap it is to move goods by train.
The advantages of electricty outweigh the cost of direct driven drive shaft like back in the old west, that doesnt eliminate the need for diesel to be burnt it just changes the generation point.