I was doing a browse through TV Tropes, when suddenly a vivid memory of a story I read popped out at me. The male protagonist, for some reason, has habitually memorized train schedules since he was a child. Some part of me wants to say that he does so as a coping mechanism, perhaps to provide a sense of order to the world, or because of a personal trauma related to train, but perhaps just a facet of his personality. This comes in handy later in the story when he (and I think a female companion) are being pursued by some monster or creature, and he uses his memorized knowledge of the train timetables to ensure that he crosses a track at just the right time such that the pursuing monster and hit (and I believe killed) by the train. I believe this was set in the 20th century, and that magic was not a common thing, rather that the male protagonist had been dragged into it after a mundane life.
Unfortunately, that's pretty much all that I can remember about this other than that I think it was part of a larger novel, and that I think it was at least five years ago, probably more than ten.