Please edit it to use code tags like in you first post ![]()
And a little tip, once you start numbering variables, arrays are the answer
See Gammons Tip 1 (and for more).
But worst, you give pins names but never use them! Go and use the names!
And don't just make all the variables global.
After some updates
const byte SwitchPins[] = {2, 4};
const byte MotorLedPins[sizeof(SwitchPins)] = {3, 5};
bool buzzer = false;
void setup() {
 // put your setup code here, to run once:
 Serial.begin(9600);
 for(byte i = 0; i < sizeof(SwitchPins); i++){
  pinMode(SwitchPins[i], INPUT);
 }
Â
 for(byte i = 0; i < sizeof(MotorLedPins); i++){
  pinMode(MotorLedPins[i], OUTPUT);
 }
}
void loop() {
 // put your main code here, to run repeatedly:
Â
 for(byte i = 0; i < sizeof(SwitchPins); i++){
  if(digitalRead(SwitchPins[i]) && !buzzer){
   digitalWrite(MotorLedPins[i], HIGH);
   buzzer = 1;
  }
 }
Â
 if (Serial.available() > 0)
 {
  Serial.print("Buzzer state: ");
  Serial.println(buzzer);
  if (Serial.read() == 'R')
  {
   Serial.println("LEDs set off");
   buzzer = false;
   for(byte i = 0; i < sizeof(MotorLedPins); i++)
   {
    digitalWrite(MotorLedPins[i], LOW);
   }
  }
 }
}