The fact that you can use combustion to generate electricity, means they are interchangeable. The other comment is probably more on point about conversion effeciency.
This is an accounting issue, not a question of thermodynamics.
Electricity typically refers to grid electric. We don’t count non plug-in hybrid electrical output as “electricity.” That’s how energy use can be stable while electrification increases.