Space-air-ground whole networks (SAGINs) are a good mode for realizing full-range connection through smooth coordination of satellite groupings, unmanned air machine (UAVs), and ground base stations. But, the dynamic and heterogeneous property of SAGINs brings about key difficulties for resource arrangement, which include time-changing network topological structure, heterogeneous link features, and the requirement of distributed decision making among multiple network layers. Current resource allocation methods, which mainly depend on centralized optimization or single-agent reinforcement study, cannot fully capture the complicated inter-layer dependence relations and hence have bad expansibility in large-scale SAGIN scenes. For breaking through these restrictions, this paper puts forward SAGRS (Space-Air-Ground Resource Scheduler), which is a dynamic resource scheduling framework that has combined multi-agent reinforcement learning (MARL) with graph neural networks (GNNs) to achieve effective and self-adaptive resource management in SAGINs. Firstly, one Heterogeneous Topology-Aware Graph Modeling (HTAGM) module is put forward, which is constructed by a dynamic heterogeneous graph expression of the SAGIN topology that captures the different features of satellite, UAV, and ground nodes together with their connection that changes along with time, therefore enabling the structured information gathering to be completed across all network levels. Second, a GNN-Enhanced Multi-Agent Policy Network (GEMAP) is introduced, which embeds the graph-structured network state into each agent’s observation space through a message-passing GNN architecture, allowing agents to make locally executable scheduling decisions informed by global topological context. Third, a Hierarchical Credit Distribution with Hierarchy-Knowing Reward Shaping (HCRS) mechanism is been designed, which decomposes the whole network use value into reward parts that each tier have, and uses a counterfactual base line to correctly give the contribution of each individual agent, therefore it quickens the speed of convergence and hence raises the cooperation degree among heterogeneous agents. Fourth, we put forward a Mobility-Predictive Action Masking (MPAM) strategy, which uses orbit mechanics and UAV path forecast to actively hide unworkable scheduling actions brought by coming topology changes, therefore cutting exploration waste and thus promoting sample efficiency. The simulation outcomes on actual SAGIN situations prove that SAGRS obtains 23.6% higher network throughout capacity, 31.2% lower average data package delay, and 18.7% better energy use efficiency compared with advanced current baseline methods, hence it still keeps stable performance when topology changes dynamically and traffic modes are different types.