The RRs in the West (SP,ATSF) started using oil about the same time oil production began in California (early 1900s). What the RRs were using was Bunker fuel, left over after extracting the higher-dollar products like gasoline and kerosene in the refining process. It was much cheaper than coal, the refineries were happy to get rid of it for a few cents per gallon. And it was easier to burn, store, and transport than coal.