I'd say some kind of mental health problem. He was leaning in and waiving at the train, which suggests that unless he was blind or had really poor eyesight (another possibility), he would have seen the train coming and so could have reacted in time. One possibility is depression and suicidal thoughts. Another possibility is intoxication causing delayed response time.