This paper aims to assess and tackle the cyber–physical security threats stemming from vulnerabilities of battery-based electric bus (BEB) fleets to cyberattacks. An optimization model is adopted for scheduling the battery swapping in BEB fleets and is utilized for cybersecurity assessments. New methods are proposed for detection of false data injection attacks (FDIAs) against the information of the BEB scheduling model. A supervised machine learning-based method is used for identification of potential cyberattacks against the system parameters that govern the operation of the BEB transit fleet. The proposed cybersecurity model is integrated with the BEB scheduling model to form a cyberattack-resilient scheduling framework for the BEB transit fleet. Two categories of data are considered for the simulation of attack scenarios and assessment of the proposed cybersecurity framework: Type 1 – Signals that are received from sources local to the battery swapping station (BSS), and Type 2 – Signals that are received from sources external to the BSS which can be intercepted and tampered by the attacker. The simulation results are presented to evaluate potential disruptions in the BEB transit operation due to FDIAs against the system’s operating parameters. It is demonstrated that a soft cyberattack mildly deviating the fleet operating parameters, e.g., the bus arrival time by up to 10 min or battery SoC by 5%, does not cause a considerable impact on the scheduling parameters or the financial metrics. A moderate or aggressive attack, however, affecting the fleet operating parameters considerably, can adversely impact the scheduling information and the fleet financial metrics.