Sorry this is the article I meant, for some reason the link did not work.
The 97 Explorer/Mountaineer locking system has three separate relays. A "drivers door unlock" relay (does just what it says it does) is activated (pulled to ground) by the first click of the fob or the first turn of the unlock motion with outside key. The second click or second turn (within a second or so) pulls a second "all unlock" relay to ground. Pushing unlock on the rear hatch switch uses this relay. A third "all lock" relay locks all doors when it is pulled to ground.
These three relays live in a combined module (along with the trailer lights relay) behind the left rear interior trim panel. You can see them by taking off the access cover to the jack. The relay cluster mounts upward, just under the upper trim panel lip. Off a couple of inches toward the front of the truck, mounted at about a 45 degree angle, is the anti theft module (Ford calls this by a funky name - the RAP - Remote Antitheft Personality module). The key fob works through this module in getting signals to all the standard chassis/body electrics.
The "all lock" function specifically works my taking a pink wire with yellow stripe (P/Y) on the all lock relay to ground. There are two P/Y wires on the same connecter pin to this relay. One wire goes only to the rear hatch switch. This is what is working when you push that switch. This wire is being grounded by the hatch switch, the all lock relay is thus energized, and all doors then lock.
The second P/Y wire goes via a harness forward along the left side of the truck, winding in this harness down across the left rear wheel well. Somewhere near the front of the rear door opening, there is a splice (Splice S337) that brings three separate wires together to this connection. All of these wires have the same P/Y coding. One wire goes to the drivers door switch, one to the front passenger switch, and one doubles back and goes to the RAP. Grounding any one of these three wires will lock all doors, just like grounding the other P/Y wire at the all lock relay using the rear hatch switch does.
Your problem is somewhere between where this single P/Y wire (the one that does not go to the rear hatch switch) attaches to the all lock relay in the rear quarter trim panel area, and where it makes the three-way splice. I bet when you look at the relay cluster in your rear quarter panel, and see the single connector pin on the relays module that has two P/Y wires, one of those wires has been pulled off - perhaps when someone was grabbing for the jack, etc.
I have a 97 Mountaineer. The best thing I ever did was buy the Electrical And Vacuum Troubleshooting Manual off ebay for about $20. They are listed there all the time. Note that the Explorer is almost identical, but has a couple of high end unit variances. I suggest you get one of these if possible.
I also have the paper factory service manuals. They can be had on ebay for $40-50. The troubleshooting manual has only the wiring diagrams, no troubleshooting text. You can also get a one year subsciption at
www.alldata.com to view all these manuals online for about $20. You can print any page. I prefer books when trying to trouble shoot, but everything in the manual is in the alldata system.
By the way, the Troubleshooting manual is labeled "Preliminary". There was never a final version!
Hope this helps. Let me know how it goes. These electrical gremlins can wear you down.