Safety is the most important aspect of railway transportation. To ensure the safety of high-speed trains, various train components are equipped with sensor devices for real-time monitoring. Sensor monitoring data can be used for fast intelligent diagnosis and accurate positioning of train faults. However, existing train fault diagnosis technology based on cloud computing has disadvantages of long processing times and high consumption of computing resources, which conflict with the real-time response requirements of fault diagnosis. Aiming at the problems of train fault diagnosis in the cloud environment, this paper proposes a train fault diagnosis model based on edge and cloud collaboration. The model first utilizes a SAES-DNN (stacked auto-encoders deep neural network) fault recognition method, which can integrate automatic feature extraction and type recognition and complete fault classification over deep hidden features in high-dimensional data, so as to quickly locate faults. Next, to adapt to the characteristics of edge computing, the model applies a SAES-DNN model trained in the cloud and deployed in the edge via the transfer learning strategy and carries out real-time fault diagnosis on the vehicle sensor monitoring data. Using a motor fault as an example, when compared with a similar intelligent learning model, the proposed intelligent fault diagnosis model can greatly improve diagnosis accuracy and significantly reduce training time. Through the transfer learning approach, adaptability of the fault diagnosis algorithm for personalized applications and real-time performance of the fault diagnosis is enhanced. This paper also proposes a visual analysis method of train fault data based on knowledge graphs, which can effectively analyze fault causes and fault correlation.