you can compare...if you move say 100 tons of oil 1 mile by rail, and you move 100 tons of oil 1 mile via pipeline, in both cases it’s 100 ton-miles. if in the first case 10 gallons is spilled and in the second case 100 gallons is spilled, then in this example the pipeline has 10x the spillage of the railroad.
Oh, now you’re talking ratios, wasn’t mentioned earlier. I don’t know the ratios to compare, but pipelines are considered far safer. I work in oil and gas, mind you as an electrician, but I’m in contact with the people that make it all go. They always replace rail with pipe anywhere they can.