Welcome to the forum
The Automatic hubs were a problem as they got older, and new replacement parts haven't been available for many years, 1997 was last year for that type, '98-'00 were a different style which were actually worse than the older style, Ford abandoned auto hubs in 2001 and all Rangers from then on got full time locked front wheels/axles, "Live Axle" is what Ford called that.
Your best option is to switch to manually locking/unlocking front hubs, where you need to rotate the hub mechanism manually on each front wheel to lock it or unlock it.
Couple of How-Tos here: Automatic To Manual Hub Conversion
TRS Magazine - Ford Ranger Manual Hub Swap
No pulling off the rotor or wheel hub is needed.
Hopefully when the mechanic did the ball joints he replaced the u-joints in the front axles, they are not an expensive part and easy to change when doing ball joints.
Many with manual hubs leave them locked through out the winter months, so they only need to shift transfer case to 4WD and back to 2WD as needed, thats the way it is on all 2001 and up Rangers, except they can not unlock front wheels in the Summer.
Have front wheels locked only cost about .3MPG so not a big deal, but not 0MPG either, so unlocking them does save a bit.