This is an electronically controlled system, the selector switch controls the 4WD module which commands the transfer case operation. Fuse 9, 7.5A, in the Central Junction Box powers the brake lights and 4WD control module. Check that the brake lights work. If that fuse has blown, the 4WD won't work. It's possible that the switch has failed but there is more to the system.
You may need to see a Ford or Mazda specialist or an auto electric shop to diagnose and estimate this problem.
Here's a directory link for you: