Train chase sequence

In my next session, I want my players to have a chase sequence followed by a battle on board a moving train. They’ll be chasing Githyanki, so their mage hand, jump, and misty step spells will all come into play.

I have a better idea of how to run the combat following the chase, which is covered to some extent in this question. However, any 5e-specific suggestions in that area would be welcome as well.

The problem

I ran a chase sequence through a graveyard according to the stock rules (DMG 252-255) a few months ago, and everyone including me ended up getting bored before it was over, even after I put the Benny Hill theme on.

It was repetitive: players and NPCs both sprinted constantly, and few of the regular urban chase pitfalls really applied to graveyards (crowd of beggars? stained glass window? cart blocks your way?). To my discredit, I didn’t draw up a custom chase table in advance, which is why the same pitfalls kept happening over and over; that I’ll definitely fix this time around.

How do I keep things interesting throughout the chase?