Connected and automated vehicles (CAVs) can bring energy, mobility, and safety benefits to transportation. Energy savings can be achieved by solving a mathematical optimization problem for a lookahead horizon using previewed traffic information enabled by connectivity. However, it is challenging to predict short term traffic, especially for mixed-traffic scenarios, where both connected and unconnected vehicles are on the road. A unified control framework is developed that integrates real-time traffic prediction with the co-optimization of vehicle motion and powertrain operation. The framework uses real-time traffic information from V2X communication to predict traffic conditions. This predicted information, such as future trajectories of preceding vehicles and upcoming traffic signal changes, is used as constraints in an optimization problem to control the CAV's speed and powertrain operation for improved energy efficiency and mobility. Optimization problems are formulated and solved for the three most common vehicle types: internal combustion engine-based vehicles (ICVs), hybrid electric vehicles (HEVs), and electric vehicles (EVs). The effectiveness of this control framework is demonstrated in a real-world signalized corridor scenario.