Saudi Arabia, alarmed by what it sees as aggressive moves by its onetime ally, is working to counter the influence the UAE has built around the Red Sea.