efficiency equals output over input. Boiler efficiency means how much of the heat released in the fuel get absorbed by the steam.
Among the losses in boilers, excess air is the big one. air absorbs alot of heat and takes it up the stack. ideally the stack temperature wont be much above steam temperature but in practice that means about 150 degress, so stack temp of 500 degrees is not uncommon. all the air that isnt oxygen that combines with the fuel, is uselessly heated up to 500 degrees and discarded.
Oil firing should require less excess air than coal firing, certainly in stationary boilers that is true, you can run O2 in the stack down to 2% burning oil, whereas with coal, even pulverized coal, 4% is about as low as you can go.
neglecting all else, oil should have a maximum practical efficiency of around 86%, where burning coal cant be expected to do better than about 75%
I dont know if oil burners in railroad locomotives ever advanced enough to realize that better efficiency than coal, but let us say they ought to have and certainly would have by the 70s.
Another big loss is moisture. Oil contains a few percent hydrogen, so there is some resultant water vapor in the flue gas, which will result in a loss of 1 or 2 % . coal contains very little hydrogen, so has the advantage there. Coal should be dry, but in practice generally isnt, often containing as much as 5% water as delivered. all that water has to be evaporated and pumped up the stack.
wood, even well seasoned hardwood, contains as much as 30% water , and green softwood contains up to 50% water! green wood burns fine when you put it on a hot fire, no fear, lots of nice volatile, they certainly burned green wood in the wood burning days, but that moisture content together with higher excess air requirements puts boiler efficiency burning wood no better than 65%.
Another important factor is fireside fouling. of the three fuels we mentioned, coal has the worst ash, requires frequent off line cleanings, with potentially the greatest losses of efficiency between cleanings. Wood has much less ash, but still requires frequent off line cleaning.
Oil fuel contains almost no ash, so depending on the method of firing, tube cleaning can be done online with steam soot blowers.
oil wins by a wide margin, and is very convenient to fire, but is very expensive. coal is highly variable. Wood though poor in heating value, is also very cheap. so the economics of the various fuels involves more factors than boiler efficiency alone.