I think you have a transmission problem. When things get sticky in the tranny, a solenoid or a clutch piston can hang up. If either of these things happen, the clutch does not lock up. No power through the transmission. So it is either in the valve body or in the clutch piston/drum assembly. Most likely the valve body, those solenoids are tiny and a little bit of clutch material building up in the valve body could hang up a solenoid temporarily.
If the transfer case failed, it does not "unfail".
I suggest you change your tranny fluid and filter. Drain into a clean bucket and look at the color and smell for burnt odor. Over time the clutch material in an automatic contaminates the fluid (every time the clutches engage, there is a little bit of the friction material cast off into the fluid, the filter does not catch much of this material).
Larry