In Switzerland a lot of factories and warehouses have train lines built into the infrastructure to try to solve this issue, but its not always feasible to a) build that infrastructure out, especially in the US, and b) use a train to transport a few containers to its destination.
If these electric train cars could be built to interface with normal train cars, they could still take advantage of the biggest efficiency of freight trains, while also helping solve the last mile problem by splitting off from the train to get closer to their final destination.
In large cities you could lay more tracks specifically for these cars to get closer to major industry areas. Land rights are an issue but you could lay track in roads. Chicago has some remnants of street running trains, but the biggest issue is a train that's ~200 yards long is a lot more disruptive to traffic than something that's the size of a semi truck.