This is the solution Volvo has proposed except with guard rails instead of overhead wires because they are incredibly brittle. Almost anything can tear it down in inclement weather. At first glance it seems impractical because there are so many roads, but 95% of the time freight trucks say on the main highways. So you only need to electrify those.
As an added bonus, it makes self-driving trucks much much easier to implement.
The hardest part is probably standardization. You'd need buy-in from the US, the EU and probably most of South-east Asia for it to be practical.