You can call he/her a railfan, rail buff or train buff (American English), railway enthusiast or railway buff (Australian/British English), trainspotter, or ferroequinologist.