Vehicle-to-everything (V2X) communication is a pivotal technology for advanced driving, encompassing autonomous driving and Intelligent Transportation Systems (ITS). Beyond direct vehicle-to-vehicle (V2V) communication, vehicle-to-infrastructure (V2I) communication via Road Side Unit (RSU) can play an important role for efficient traffic management and enhancement of advanced driving, providing surrounding vehicles with proper road information. To accommodate diverse V2X scenarios, heterogeneous traffic with varied objectives, formats, and sizes needs to be supported for V2X communication. We tackle the challenge of resource allocation for heterogeneous traffic in the RSU-deployed V2X communications, proposing a distributed Multi-Agent Reinforcement Learning (MARL) based resource allocation scheme with limited shared resources. To reduce the model complexity, RSU is modeled as a collection of virtual agents with a small action space instead of a single agent selecting multiple resources at the same time. A weighted global reward is introduced to incorporate traffic heterogeneity efficiently. The performance is evaluated and compared with random and optimal allocation schemes in terms of Packet Reception Ratio (PRR) and communication range. The proposed scheme nearly matches the performance of the optimal scheme and significantly outperforms the random allocation scheme in both underload and overload situations.