Human errors of train drivers may cause serious damage. Therefore, research on human error prevention has been conducted by many researchers. In this context, brain activity measurement of train drivers using Near-infrared Spectroscopy (NIRS) has been conducted to monitor the condition of train drivers. In this study, we developed a compact wireless wearable NIRS that can be used in natural environments. The wearable NIRS has been used to measure train drivers brain function using a train driving simulator. Experimental results showed that brain activity of DLPFC increased when the driver made braking operation. The experiment for train driving with an accidental event was carried out to evaluate the relation between driver's attention and the brain activity. As a result, there was a difference in brain activity between with and without prior notice. Results showed that the increased attention of the train driver can be appeared in NIRS signal from the outer part of prefrontal cortex.