First of all, let me say that a train engine and an airplane engine are so different and used for a different applications. We even measure them with different units.
Airplane turbofans have their capacity measured in thrust (F). While train locomotives measure their power in horsepower/kW (P). The two measures are related by this simple formula:
So to turn thrust, which is a force, into power, you must know your travel speed.
The most powerful single locomotive ever build is the EMD DDA40X, a 230 tonmonster measuring 30m in lenght and producing 6600 hp.
The most powerful jet engine, or turbofan, is the GE90-115B, it weights about 8 ton and has a max record of 568.9 kN of thrust. It is used in the boing 777, a long range twin engine jet, so it will be used in pairs, but for fairness with the locomotive, I will only consider one engine.
So now lets look at speed. The boing 777 cruises at around 900km/h (250 m/s). So this means that power will be:
P = 568.9*1000*250 = 142 225 000 W or 190 726.867 hp
Dividing by the 2 engines: 95.363 hp
This suggests that the airplane engine produces 15 times more horsepower than the locomotive.
However, this is not a fair comparison for a couple of reasons:
The working conditions of both engines are two worlds apart. The locomotive itself actually weights as much as some editions of a full Boeing 777. And a cargo train will carry thousands of tons. The antonov Mriya has 6 engines and it holds the total record of lifting a 190 ton payload. The record for a freight train was establish in 1989 in Russia, when several diesel locomotives and 439 cars made a train measuring 6.5km in length and carried 43400 tonnes of coal Ekibastuz to Urals.
So this means that the heaviest train cargo ever was around 230 times heavier than the heaviest airplane cargo ever.
The locomotive is designed to produce tons of torque. Its starting force is actually a respectable 507 kN which is very comparable to the 514kN of thrust that the turbofan produces at sea level. While you use most of the locomotive power just to kick off the train, you don’t need that much power to keep the train moving, and you will also never reach really high speeds with a freight train. The airplane turbofan will need a lot of power not only for liftoff, but mostly to attain high speeds.
It is not common to see freight trains surpassing 130 km/h, and they are even required to travel at much lower speeds in most tracks. Passenger trains are much lighter and can travel at around 350 km/h.
The current speed record for a train in steel rails is 575km/h, while the record for an airplane is 3530 km/h. So the fastest airplane ever is 6 times faster than the faster train ever.
So, in conclusion, take the airplane engine for speed, and the locomotive for a long heavy run.