The ASDA staff would have left the company if they didn't sign a new contract. Easier to do in retail because it doesn't take a long time to train a supermarket worker, the staff who carry out the training wouldn't be interested in industrial action and the existing workers probably wouldn't have a particularly strong financial situation. Lastly, a supermarket isn't going to be front-page news if the shelves are a bit bare for a few weeks.
It takes 12-18 months to train a train driver from scratch and the drivers need to spend a lot of that time one to one with a driver instructor (DI). The drivers (well, sensible ones anyway) will have a large enough savings pot to weather a few months with no income. If, say, half the drivers refused a new contract, the remaining DIs handed back their DI tickets to become ordinary drivers again (or simply refused to allow trainees to drive) and the remaining drivers staged a rest-day ban, the TOC concerned would be totally stuffed. TOC management know this.