The Intelligent Transport System (ITS) is an emerging paradigm that offers numerous services at the infrastructure level for vehicle applications. Vehicle-to-infrastructure (V2I) is an advanced form of ITS where diverse vehicle services are deployed on the roadside unit. V2I consists of distributed computing nodes where transport applications are parallel processed. Many research challenges exist in the presented V2I paradigms regarding security, cyber-attacks, and application processing among heterogeneous nodes. These cyber-attacks, Sybil attacks, and their attempts cause a lack of security and degrade the V2I performance in the presented paradigms. This paper presents a new secure blockchain framework that handles cyber-attacks, as mentioned earlier. This paper formulates this complex problem as a combinatorial problem, encompassing concave and convex problems. The convex function minimizes the given constraints, such as time and security risk, and the concave function improves performance and accuracy. Therefore, numerous constraints, such as time, energy, malware detection accuracy, and application deadlines, require optimization for the considered problem. Combining the jointly non-dominated sorting genetic algorithm (NSGA-II) and long short-term memory (LSTM) schemes is the best way to meet the problem’s limitations. In this study, the paper designed a malware dataset with known and unknown malware. The different kinds of malware lists (e.g., cyber-attacks) are considered in the form of known and unknown malware lists with the characteristics, size of code, where malware comes from, attack on which data, and current status of the workload after being attacked by the malware. Our main idea is to present blockchain, NSGA-II, and LSTM schemes that handle phishing, routing, Sybil, and 51% of cyber-attacks without compromising application performance. Simulation results show that the study reduces delay and energy, improves accuracy, and minimizes security risks for vehicular applications.