I'm not sure how they calculate it, since I don't work for them. They sell train tickets though... they probably have lots and lots of data on city pairs, costs per km, costs per station, etc. It's not that difficult to create meaningful insights with that kind of data. Nowadays any ERP can do...