If a Perko switch, and most are, then on battery one polarity is right, and on battery two polarity is right, then it cannot be set up as 24 volts. If so the pump would likely be burned out already. If polarity is wrong, the pump would spin backwards. The switch is not making a proper connection inside, which is usually because these switches really are not sealed, and the corrosion is shorting it out.
Try taking some alligator clip leads off battery one and two to set it up as parallel, not series, and see it the bypass to the pump changes things. If it works properly on the bypass, throw away the switch and start over.
Not the first corroded switch issue, and not a serviceable issue for the switch
Drewski