My truck has a similar problem. I am assuming that the light on the dash does not light up when you turn the switch, regardless of the hubs. I have asked several people including taking mine to the ford garage. The only answer I get is "we have never had a truck do this before." and they just wanted to throw expensive parts at it. After pluging and unpluging every connection I could find I found that taking out the relays on the firewall directly in front of the driver would make it go into 4wd if the key was on regardless of the position of the 4wd switch.
To make a long story short if i disconnect my batteries for ten minutes then reconnect my 4wd will work for a month or two depending on how much I use it. The more I use it the longer it lasts. Just something to try. I do not know why this works, but it does and it is cheaper than replacing parts that obviously work even if for only a while.
If anyone has any other ideas I would like to hear them. It would be great to not have to remove the battery cables this often. But it does keep them clean.
Hope this helps.