The man had just completed a course of treatment intended to cure him of blindness. He had high hopes of success. He travelled home on the train with the handkerchief as a blindfold to protect his eyes from the light.
He could not wait and decided to remove the blindfold to test his eyesight. When he removed the blindfold, he could see nothing and assumed that the treatment had failed. He could not face the future as a blind man and, therefore, he stepped out of the speeding train to his death.
The treatment had, in fact, been successful, but he had unfortunately removed the blindfold while the train was in a long tunnel. The carriage was in complete darkness.