Groaning noise from front of pickup

I own a 1997 Dodge Ram 1500 4x4 pickup with a 5.9l V8 engine, auto trans. At speeds above 30 mph the truck will occassionally make a groaning type noise (almost sounds as though something is trying to turn, but can’t). This is often accompanied by a vibration felt in the floorboards. A mechanic took it for a test drive and then showed me some rust near the front u-joints by my wheels, and took me for a test drive as well. The truck never made the same noise while he drove and I want to be sure that it is the u-joints, though they probably need to be replaced regardless. Thanks for any help that you can afford me.