The UAV-assisted space–terrestrial integrated network provides extensive coverage and high flexibility in communication services. UAVs and ground terminals collaborate to train models and provide services. In order to protect data privacy, federated learning is widely used. However, the participation of UAVs and ground terminals is not gratuitous, and reasonable incentives for federated learning need to be set up to encourage their participation. To address the above issues, this paper proposes a federated reliable incentive mechanism based on hierarchical reinforcement learning. The mechanism allocates inter-round incentives at the upper level to ensure the maximisation of the server’s utility, and performs inter-client incentive allocation at the lower level to ensure the minimisation of each round’s latency. The reasonable incentive allocation enables the central server to achieve higher model training accuracy under the limited incentive budget, which reduces the cost of model training. At the same time, an attack detection mechanism is implemented to identify malicious clients participating in federated learning, preventing their involvement in aggregation and revoking their incentives. This better ensures the security of model training. Finally, we conducted experiments on Fmnist, and the results indicate that this method effectively improves the accuracy and security of model training.