Electric vehicles (EVs) have demonstrated significant potential for reducing greenhouse gas emissions, but their energy consumption and emissions are strongly influenced by external factors such as traffic density, road gradients, and energy grid composition. This study integrates real-world data, physical simulations, and machine learning models to analyze these interactions. Results show that traffic density exceeding 400 vehicles/km² leads to a sharp increase in emissions, reaching over 150g CO₂/km in urban areas. Urban driving conditions also exhibit high energy consumption at 0.22 kWh/km, compared to 0.15 kWh/km in highway scenarios. Steep road gradients (>15°) significantly increase energy consumption, doubling values compared to flat conditions, and raise emissions by 40% in high traffic density environments. Renewable-dominant grids, as seen in Shenzhen (75% renewable energy), reduce emissions by up to 30% compared to fossil fuel-reliant grids. Advanced machine learning models, including Deep Neural Networks (DNN) and Long Short-Term Memory (LSTM), provide accurate predictions for energy consumption and emissions, with the LSTM model reducing errors by 9.5% in dynamic scenarios. Real-time optimization strategies based on these models can achieve energy savings of up to 12% under mixed driving conditions. The findings highlight the critical role of traffic flow management, renewable energy grid expansion, and EV design improvements such as lightweight structures and regenerative braking systems for steep gradients. This research contributes actionable insights to enhance EV efficiency and reduce emissions, supporting sustainable transportation and urban development.