Optimised State-Dependent Sampling Control for Heavy-Haul Trains