Man arrested after six-hour stand-off closes railway line