To enhance the safety and reliability of fuel cell vehicles, a remote monitoring system based on 5th generation (5G) mobile networks and controller area networks (CANs) was designed, and a random forest (RF) algorithm for the fault diagnosis for eight typical malfunctions of its powertrain system was incorporated. Firstly, the information on the powertrain system was obtained through a 5G-based monitoring terminal, and the Alibaba Cloud IoT platform was utilized for data storage and remote monitoring. Secondly, a fault diagnosis model based on the RF algorithm was constructed for fault classification; its parameters were optimized with a genetic algorithm (GA), and it was applied on the Alibaba Cloud PAI platform. Finally, the performance of the proposed RF fault diagnosis model was evaluated by comparing it with three other classification models: random search conditioning, grid search conditioning, and Bayesian optimization. Results show that the model accuracy, F1 score, and kappa value of the optimized RF fault classification model are higher than the other three. The model achieves an F1 value of 97.77% in identifying multiple typical faults of the powertrain system, as validated by vehicle malfunction data. The method demonstrates the feasibility of remote monitoring and fault diagnosis for the powertrain system of fuel cell vehicles.