This paper proposes that exploitation of between-variation is required to estimate economies of density in railway datasets because of the need to capture the step-function impact of traffic on preventative maintenance regimes. Our empirical case is based on a panel dataset of 1,149 track sections (2013–18) for the French rail network. The work is important in the policy context in terms of setting rail track access charges in line with marginal cost principles and meeting EU legislative requirements; it also has implications for the wider rail cost-function estimation literature.