Welcome to the forum
Most likely a GEM issue, Generic Electronic Module(GEM), this controls cab electrics, and 4WD lights and shift motor.
Inside the shift motor is a wheel that turns as the shift motor turns, this wheel has 5 contacts(well 1 Ground and 4 contacts), when motor turns, these contacts open and close, that is how the GEM can tell what "gear" the transfer case is in.
And GEM activates the dash lights accordingly.
In this thread there are pictures of the shift motor and contact wheel inside: http://www.explorerforum.com/forums/...-motor.123542/
So could be the wheel is bad, or the GEM.
4WD lights flash when GEM gets confused, like if it closed the motor power relays and contacts didn't change, so no movement from motor.
When you turn on the key both 4WD lights should come on, that's the GEM powering up.
Does that happen?
There is a 4x4 shift module, it is just 2 relays in a box usually in with the GEM behind the radio,
The shift motor is a DC motor, so it can spin clockwise or counter-clockwise by reversing the polarity, +/- or -/+
That's what the 2 relays are for, the GEM uses them to turn motor in the direction to get the "gear" selected.
GEM "knows" what "gear" transfer case in by contacts on that wheel.
If this relay module was bad then motor wouldn't move, and if motor was stuck in 4Low position the 4Low light would stay on, but lights should start flashing if you selected 4High or 2WD because GEM wouldn't see contacts changing, motor not moving.
Here is the wiring diagram for 1998 Ranger 4WD
Always check fuses first, test them with meter, eyeballs are for pretty girls not fuses