Generator powered by what? If its a diesel powered generator, that's even less efficient and more polluting than just using diesel trucks in the first place.
As I understand the benefits of electric cars themselves, the burning of hydrocarbons at scale is more efficient than piecemeal. So if the ‘bus’ contained a turbine, there would probably be net benefit. Or a nuclear bus!
Plus, even if it’s equal to the present state of affairs, we need a practical road to electrification of transport. I’m sure there are many cheaper options, it’s just fun to think about the infrastructure options.