Razoul is the captain of the guard and has complete authority over all guards in Agrabah.
Fazal is darkly colored and very fat, with a long mustache. His lines usually make reference to food.
Hakim is pale, very thin and tall. His lines generally put a pessimistic take on the situation.
Nahbi is slightly paler and less fat than Fazahl. He is the shortest of the three.
In the first movie, the guards are the main security force of Agrabah, mainly keeping the royal family safe or trying to stop thieves from stealing. The Royal Guards are also shown to keep trying to arrest a certain street rat that always gets away from them; Aladdin. Later, by Jafar's orders they eventually find Aladdin's hovel and arrest him, but at the same time they also find Princess Jasmine, who had earlier escaped from the palace. When she orders them to release him, Razoul, The Captain of the Royal Guards apologizes saying they can't and escort the Princess back to the palace.
For the rest of the film, the guards don't do much, having only a minor /recurring role, but some of them along with Razoul do appear when a disguised Aladdin who goes under the name of "Prince Ali" arrives in the city, seeking Princess Jasmine's hand in marriage. Later on after Aladdin and Jasmine arrive back at the palace after going on their first carpet ride together, the guards under Jafar's orders kidnap Aladdin, knock him unconscious and throw him off a cliff. It's most likely that Jafar had hypnotize the guards into doing these deeds or lied to them saying "Prince Ali" was up to no good. After that the guards don't appear for the rest of the movie.
In the second film, despite being engaged to marry Jasmine, the guards haven't changed their opinion of Aladdin, seeing him nothing than a mere "street rat" as they always have. They are shown to have again a bit of a minor/recurring role as they had in the first film. They first appear trying to arrest the thief Abis Mal who then escapes in a wagon carrying chickens and eggs and then later appear when the Sultan tries have the guards arrest Iago. Later, when Aladdin arrives back at the palace to let everyone know that the Sultan had been kidnapped, the guards however have been deceived by Jafar, arrest Aladdin believing him to have murdered the Sultan. Later, the guards under "Princess Jasmine's" orders are to have Aladdin die as punishment, when really it was Jafar disguised as Jasmine, when the real princess had already been captured and locked in Jafar's lair. However, thanks to Iago, he was able to free Genie and thus saved Aladdin before he was killed by Razoul and they are been severely punished by the Sultan for falling into Jafar's tricks.
They appear in the Aladdin series numerous times, with appearances in Air Feather Friends, To Cure a thief, Web of Fear, Mudder's Day, I Never Mechanism I didn't Like, Forget Me Lots, Sandswitch, the Day the Bird Stood Still, Caught by the Tale, Poor Iago, Secret of Dagger Rock, The Way We War, Armored and Dangerous, Black Sand, Vocal Hero, Seems Like Old Crimes Part 2, Destiny on Fire, Return of Malcho, The Spice is Right, Hero with a Thousand Feathers, Riders Redux, While City Snoozes, the Ethereal, The Shadow Knows, and the Great Rift.
The game is essentially a retelling of the first film, as such the guards serve the same role as enemies and bosses which Aladdin must defeat to progress.
While the Guards did not appear in the first game in the series despite having a loose adaptation of the first film, they would go on to appear in a mobile spinoff that followed the film a bit more closely, however their role here is significantly reduced.
In this movie that's a live action adaptation of the first film, the guards serve somewhat similar roles but posses none of their original names, with Razoul being called Hakim while a merchant now bears the name Razoul for some reason.