This is likely the electrical plug to the rear differential that got sand in it or got knocked loose. Any issue with the plug connection with the rear differential will cause the car to stop using rear drive. Just unplug the rear diff plug (no tools needed and it's easy to find since it's the only wires going to the rear diff) blow out any sand and plug it back in. A similar thing happened to me after driving in some ice slurry and some road salt got into the plug. This has helped others as well.
Hope it helps
Hope it helps