Although dry casks now in use could probably maintain integrity during a train crash, I don't think any are designed for that specific type of accident. That is because they are too big to load on a train car.The casks for dry storage are constructed of extremely strong design and material. It is reported that they are designed to maintain integrity in a train crash.
There was once a plan to build dual-use casks that could be used for storage and transportation. That would have saved utilities from having to load the fuel into dry casks and then unload it to reload it into transportation casks. But I don't think anyone pushed such a design through the NRC licensing process.