This study investigates the neural mechanisms underlying the inhibitory control of speed when drivers encounter varying levels of risk posed by pedestrians and motor vehicles. Two variables (risk level and risk type) were controlled in this study. The experimental materials included traffic images depicting pedestrians or motor vehicles, each associated with different risk levels. Drivers were presented with these images and tasked with adjusting their vehicle speed according to the traffic scenario. Specifically, they were instructed to either maintain their current speed or decelerate as needed. Electroencephalograms (EEGs) responses were simultaneously recorded. Results showed that in low-risk scenarios, the deceleration score was significantly higher for pedestrian risks than for motor vehicle risks. Under conditions of elevated risk, various risk types did not result in significant variations in deceleration scores. EEG data revealed that high-risk scenarios elicited a larger amplitude in the P3 component compared to low-risk scenarios. Additionally, the average amplitude of the N2 component was greater for pedestrian risks than for motor vehicle risks. These findings suggest that risk level and type do not act as independent factors influencing speed control. Specifically, when the risk originates from pedestrians, drivers tend to reduce their speed even when the risk level is low, in order to mitigate potential hazards and prioritize safety. Furthermore, high-risk situations elicit a more pronounced brain response and demand greater attentional resources compared to low-risk situations. This study provides valuable insights for establishing speed limits based on different sources of risk in driving scenarios.