Hierarchical Optimal Control of a Group of Electric Vehicles for Maximizing Energy Efficiency and Battery Life