I'll just mention a few numbers to put RR history writing in perspective:
The typical run for a railroad history or railfan book seems to be about 3000 copies. (Yeah, if you're the late Stephen Amrose -- a difficult feat -- or even Maury Klein, you can count on larger runs, but they're hardly typical.)
Nowadays, publishers seem to be getting tight on royalties. The best that can be done is 10% on the _realized_ price -- that is, the price the publisher actually gets, not the retail price. Since the standard bookseller discount is 40% (with some variations, depending on quantity and whether the bookseller has return privileges), you can probably figure a royalty based on maybe 60% of list price. Furthermore, many publishers now (especially university presses, which I've most recently dealt with) have cut the royalty rate down to 5-6%.
OK, so you're getting, say, 6% on the realized price of 3000 copies of a book with a retail price of, say, $40. That gives you a glorious royalty (spread over several years) of $4320, to which you apply all your expenses. The good part, I guess, is that the expenses are deductible, so at least you won't have to worry much about income tax.
A few -- very few -- friends of mine are able to eke out a living as historical consultants. There seem to be an increasing number of historic restoration and preservation projects, many of them railroad-related, and these often require a detailed historical background to qualify for grants, state or federal historic register status, etc. Sometimes the pay isn't bad, but of course it's a feast or famine kind of business, and you have to establish some kind of reputation in the field before anyone asks your help.
So the bottom line of all this really goes back to the top response in this thread -- get a real job first, do your writing and/or lecturing on the side, and maybe -- just maybe -- you could work up to a paying job in the RR history field.