The space-air-ground (SAG) network boosts the application for the imperfect ground infrastructure in Internet of remote things (IoRT) networks. Considering the limited battery life of IoRT devices and the difficulty of replacement, unmanned aerial vehicle (UAV) is deployed in SAG networks to assist wireless power transmission (WPT) in order to achieve sustainable device operation and enhanced computational capability. In this paper, a three-layer SAG network is proposed to serve IoRT devices. Given the intricate and unpredictable environment of the IoRT SAG network, the tasks need to be timely processed by the IoRT devices without prior knowledge, which remains an ongoing challenge on available resources management. Thus, an online resource scheduling scheme that jointly optimizes CPU cycle frequency, power control and UAV trajectory planning is developed. We aim to maximize the long-term time-averaged total system computation rate while satisfying network stability and sustainability. The studied problem is a nonlinear stochastic optimization problem, which is decoupled into three sub-problems by leveraging Lyapunov optimization. Furthermore, we propose an online algorithm, namely JCPUI, to obtain the optimal CPU cycle frequency, power control, and UAV trajectory planning. Besides, performance analysis is provided for the proposed JCPUI, which elaborates that the control parameter V affects the trade-off of the total system computation rate and system stability. Simulation results validate the theoretical analysis and demonstrate the effectiveness of JCPUI. INDEX TERMS Internet of remote things (IoRT), space-air-ground (SAG), wireless power transfer (WPT), unmanned aerial vehicle (UAV), stochastic optimization.