Rail man pockets £18m after sale