Turn key on put in drive and turn on 4x4 switch, is the car like symbol showing in the gauge in high and low, indicating 4x4 ? From what you described it should be showing the car like symbol, because you have four wheel drive in forward, now shift in to reverse, if you lose the car like symbol in the gauge, it is electrical. This was my problem. Try leaving it in reverse with 4x4 on and I want you to move a wire around while looking at the gauge. this wire is cross from the starter. As I moved it I saw the 4x4 come on and go out. So I changed that peace of wire harness. It's a little tricky, there are spring loaded pins.
Good luck, keep me posted.