The research on cascading failures in static networks has become relatively mature, and an increasing number of scholars have started to explore the network scenarios where mobile nodes and static nodes coexist. In order to enhance the resilience of static-mobile networks against cascading failures, an algorithm based on Q-learning for optimizing the path of the mobile node is proposed in this paper. This paper proposes a Q-learning-based algorithm for optimizing the path of the mobile node. To achieve this objective, a cascading failure model is established based on sequential interactions between mobile nodes and static nodes in this study. In this model, the motion paths of the mobile node are generated by the Q-learning algorithm. Based on this approach, extensive experiments are conducted, and the results demonstrate the following findings: 1) By increasing the adjustable load parameters of static nodes in the network, the occurrence of cascading failures is delayed, and the frequency of cascading failures is decreased. 2) Increasing the adjustable load parameter, capacity parameter, and network size of static nodes contributes to the network's resilience against cascading failures. 3) As the communication radius of the mobile node increases, the scale of failures in the static network initially increases and then decreases. 4) Different trajectories of the mobile node have a significant impact on network robustness, and paths generated based on Q-learning algorithm exhibit significantly improved network robustness compared to Gaussian-Markov mobility trajectories. The Q-learning algorithm is compared to the Ant Colony Optimization algorithm in terms of execution time, path length, and network robustness, and the Q-learning algorithm demonstrating favorable performance. These experimental results can be valuable for theoretical research on cascading failures in static-mobile networks.