Trajectory prediction for heterogeneous multi-agent systems within local areas is essential for ensuring the safe and efficient operation of autonomous vehicles. However, complex urban traffic intersection scenarios present significant challenges due to diverse information exchanges, as well as the need for continuity and temporal consistency in behavioral intentions. Existing anchor-free query generation methods often suffer from mode collapse and training instability, and struggle to maintain intent continuity and temporal consistency at complex intersections. To address these challenges, this paper proposes a two-stage heterogeneous edge-augmented graph attention network (HEGANet) for dynamic trajectory prediction. The first stage performs spatiotemporal context encoding to extract dynamic agent features. These features are combined with heterogeneous graphs featuring directed edge attributes to model spatiotemporal interactions between agents. A heterogeneous graph attention network and a dynamic feature gating mechanism are introduced to optimize feature weighting, while a multi-scale dynamic interaction graph attention network is utilized to further model both inter-agent and intra-agent dynamic interactions. In the second stage, a multi-layer perceptron (MLP) decodes the predicted embeddings from the first stage, and iterative optimization is applied to refine multi-agent, multi-modal future trajectory predictions. Experimental results on the INTERACTION and Argoverse datasets demonstrate that the proposed model significantly outperforms existing methods in terms of trajectory prediction accuracy.