We analyse maintenance cost data for Swedish railway infrastructure in relation to traffic volumes and network characteristics, and separate the cost impact from passenger and freight trains. Lines with mixed passenger and freight traffic, and dedicated freight lines are analysed separately using both log-linear and Box-Cox regression models. We find that for mixed lines, the Box-Cox specification is preferred, while a log-linear model is chosen in the case of dedicated freight lines. The cost elasticity with respect to output is found to be higher for passenger trains than for freight trains. From a marginal cost pricing perspective, freight trains are currently over-charged, while passenger trains are under-charged.