The biggest reason why companies use trucks instead of trains is that you can fill a semi truck and send it off a lot quicker than you can fill a whole train. I think rail cars capable of individual operation would work great in place of semis, because you get all the benefits of the smaller size, but you could also link them up into full trains for efficiency when possible.
The problem is mostly that we don’t build rail spurs in industrial areas anymore. If we did, then these cars could detach from trains at a shunting yard, and split up to head to all their different destinations individually. But the only last-mile infrastructure we currently have is roads.