In today's world, electric vehicles (EVs) play a significant role in transportation automation systems, and these vehicles are the replacement for fossil fuel usage vehicles. An EV generally depends on electric charges where the appropriate usage, charging, and energy management are the key constraints in EVs. To overcome these issues, proper energy management is essential in current EV management. In this paper, a novel blockchain-based secure energy management has been proposed to provide efficient energy management in transportation automation. Primarily, the EVs have connected to the Internet of Things (IoT) sensors for collecting information like charging level, distance to be traveled, and location of the EVs. This information has been processed by an information center and transferred to the random forest classifier to identify the price of charging. Afterward, it can be transferred to the power scheduling algorithm for finding the nearest charging location (shortest distance) and time of charging to a specific EV. Finally, this information is stored in blocks to mitigate the misleading of EVs and to offer secure price transactions between the users and charging stations. The results manifest that the proposed scheme provides improved EV management with 94.5% of accuracy and maintains 10% lesser communication overhead as compared with existing state-of-the-art techniques.