Among traffic crashes, truck crashes are usually more severe and cause greater harm to other involved traffic participants, particularly vulnerable road users such as the drivers of two-wheelers. Automatic emergency braking (AEB), also known as autonomous emergency braking, has been demonstrated to be a safe, efficient, and high benefit–cost ratio advanced driving assistance system that can reduce driver errors and collisions, but at present, AEB research is mainly carried out for passenger cars with little specific attention to trucks. In this study, a three-stage AEB algorithm was designed to control longitudinal collision scenarios between trucks and two-wheelers. A total of 121 crashes were collected from the China In-Depth Accident Study Database (CIDAS). The crashes were reconstructed and verified in the MATLAB/Simulink simulation platform. The experimental results show that our proposed method avoided 35% of the collisions. Analysis of the simulation results showed that the scenarios in which the proposed system failed to avoid collisions mainly had the characteristics of rapid increase in the urgency of the conflict, insufficient truck deceleration time, and insufficient braking distance. Random forest was used to analyze the factors affecting the AEB’s collision avoidance, and it was found that collision angle, reflecting the urgency of two-wheeler lane changing, was the most significant factor. The results have at least two practical implications. It is of significance to (1) educate two-wheeler drivers to carefully observe the road conditions before making decisions and (2) develop multi-sensor AEB systems for trucks.