Mitsubishi Montero engine out while driving, turns over, will not restart

95 Montero. 170,000 mi. 4-WD. While driving around 30 mph., engine quits. Just after I turned on semi-functional air conditioner. Next, it would not turn over until I jiggled 4-wheel drive shifter from ordinary to 4-low to mid-range. When it did turn over, engine did not fire. Also, gets sluggish after a few tries on starter and nearly killed battery. Two more things. After doing 4WD on a beach, noises from the front and noises in reverse if any version of 4wd selected for several months. Also, just had alternator and new battery installed. No warning light signals or other unusual signs. Anybody have any ideas and (a) how to fix it, and (b) if it is worth towing this beast to a garage or selling it right off the edge of the highway for junk? (The alternator and battery alone cost $700 where I live in NE)??