Do you?
You can't drive a truck sideways (from the side of a parked train); you can't drive a truck across multiple rail platforms (from the end of a parked train); and you can't efficiently split up the train in individual cars, bring them to a rail-end where they can be driven to/from and reconnect them, that would be much more expensive in terms of machinery (locomotive) and operator use than a crane; train cars can be reshuffled but it adds significant time and effort compared to just lifting a container from a truck onto a train, which is how it's usually done. You would also need specialty (longer) flatcars to fit not only the length of the container but the truck as well.
https://upload.wikimedia.org/wikipedia/commons/e/e5/DTTX_724...
This is how we loaded our vehicles onto train when I was in the US Army. Everything from small vehicles to large trucks. There were removable pieces connecting the cars so they could be driven over.