it is 4wd, correct? Your drive motors on the solid axle are still working while the drive motors on the steer axle are locked?
I have no access to JLG information at this time, but I suspect that whatever switches from 4wd to 2wd is malfunctioning. Not sure what that device is or where it might be located. I believe manuals are available for the 40HA from the JLG web site still. If you don't have manuals for this machine, it might be a good time to get them.
Looking at the locked drive motors, there should be 3 or 4 hydraulic hoses. Two larger ones, and one or two smaller ones. One of the smaller hoses will be the brake, other other small hose will be a "case drain" going back to the hydraulic tank. The brake hose will be going to a location closest to the wheel. You can follow that hose back and see where it goes to.