Doc said very plainly (and very proudly), "It runs on steam!" Steam locomotives did have steam driven electrical generators on them to power the lights and other electrical appliances, both on the locomotive and on passenger cars if they happened to have electric lights, even as early as 1885.
If I remember correctly, the voltage was quite low, about 32 volts DC. However, if the Doc enlarged the generator to handle a higher load, then stepped up the voltage with transformer coils, he could get his 1.21 gigawatts purely by steam alone. You only need that amount of power for a short burst, when the Flux Capacitor activates at 88 mph, so there could be a bank of capacitors or batteries residing in the tender behind the locomotive to store up the charge.
As mentioned by Valorum, there is a spinning set of coils set between two magnets on the locomotive's left-hand side which is likely the electrical generator, and as it continues spinning even as the locomotive is at rest it is likely building up the charge to engage the flux capacitor up on the front of the locomotive as well as providing power for auxiliary functions as need be.
Digging up the DeLorean buried in 1885 for the Mr. Fusion is a non-starter for one very good reason. Suppose Doc accidentally seriously damaged it by causing a cave-in or something as he was digging it out, rendering it unusable later on in 1955 when Doc and Marty dig it out of the mine to send Marty back to 1885? That would cause a serious time paradox, so the best thing to do would be to leave it where it was (which is why in Part III Doc and Marty don't try to dig it up for spare parts after they blow out the fuel injection manifold trying to run the car's engine on the saloon's rotgut liquor).
Sitting around and waiting for a lightning strike is also a bit of a non-starter. I mean you could wait potentially for months, maybe even years for a lightning storm, and even if there was a lighting strike, it wouldn't necessarily be on the railroad tracks as you were running the time-travel train.
The easiest way is the generate the power using the locomotive's own steam to drive a generator, and if I may paraphrase Bob Zemeckis, the Doc being a man of Science, he figures out a way to make it work using the 1885 technology, and even after a visit to the future to get the train hover-converted, he chose not to mess with anything else on it, as it already worked just fine running on steam. Doc is also hinted at being a bit of a steam train fan, as when he blows the whistle on the locomotive he and Marty use to push the DeLorean up to 88mph in Part III ("I've wanted to do that all my life!"), I don't think he'd be keen to convert it to some future-centric source of power anyway, it's just more fun for it to be a steam locomotive.