The cost of trucking is dominated by the fuel-cost-per-ton-mile.
Whereas the cost of moving 1 ton of goods over rail is dominated by the cost of labor, the cost of moving 1 ton of goods via truck is dominated by the cost of fuel.
In point of fact, rail freight gets ~436 ton miles per gallon.
The only mode of transport that gets more ton-miles-per-gallon is water transport (DSO, dry bulk shipping, oil and gas tankers, panamax, river barges, etc...)
The edge case is liquid and gaseous hydrocarbons, which can be transported via pipeline. It's no surprise that Buffet has been buying up oil and gas pipelines over the past several years.
The only catch here is that waterway transport inside the United States has sub-optimal efficiency due to the Jones Act.
(Electric engines are out of the question for BNSF. Insanely high cost to electrify the network.)
Oil isn't used to generate electricity. At least not much. Look for coal, nuclear power, some natural gas.
In general electricity is much cheaper than oil based forms of energy. The reason why cars run on gasoline and Diesel is, that those have a much higher energy density than current batteries.
In 2009, the industrial price of electricity in California is around $0.10 / kWh. That's $0.028 / MJ. The current price of diesel oil is $2.801 / gallon, which is $0.616 / litre which is $0.016 /MJ (assuming 38.6 MJ/l as the heat of combustion of diesel oil).
So diesel oil is $0.016 / MJ while electricity is $0.028. As you can see, electricity is a _lot_ more expensive in ideal circumstances (all the energy is converted to useful work). Now obviously, not all of the heat in the combustion engine can be converted to mechanical energy so there's quite a loss there while electrical engines have very good energy efficieny ratios, but still, oil is a lot cheaper than electricity, and that is the main reason it is used as the primary energy source.
EDIT: I have made a huge (100x) mistake, thanks for eru for spotting it, it's corrected now. Still, my point stands.
In principal electricity should be at least as cheap as Diesel in terms of usable energy --- because if it was more expensive you could use Diesel to generate electricity (arbitrage opportunity).
Also the efficency of moving Diesel engines is not that good. Less than 30% or so. And they can't get much better without raising their working temperature, because the theoretic maximum (Carnot Engine) isn't that much higher. Moving engines have to be quiet compact --- on trains less so than in cars. The big stationary engines in the power plants do not have to conform to this limitation. (But there is some loss in transmiting the electrity through the power lines, too.)
I'll come back with some numbers soon.
Edit: I don't know why someone downvoted you. If your numbers are wrong, they should they so. If not, there's no reason to downvote.
"Even in sparsely populated large countries (Finland, Sweden) electrification has proven to be more economical than diesels."
(from http://en.wikipedia.org/wiki/Dieselization)
10 $ per kW/h sounds very high. Are you sure it's not 0.10 $ per kW/h?
When you buy metered electricity, you're paying for the end product. Internal combustion engines are roughly 20% efficient on average, going from chemical energy to kinetic. Electric motors are 90%+ from electricity to kinetic.
"Electric locomotives benefit from the high efficiency of electric motors, often above 90%. Additional efficiency can be gained from regenerative braking, which allows kinetic energy to be recovered during braking to put some power back on the line."
(From http://en.wikipedia.org/wiki/Internal_combustion_engine#Ener... and http://en.wikipedia.org/wiki/Electric_locomotive )
I would assume that the fuel costs of diesel locomotives are just as tied to oil prices than fuel costs of trucks. The operating costs of electric locomotives would get equally more expensive as well as electricity prices are not independent of oil prices (and electricity is always more expensive than oil).