Well, from a literary point of view, from the two genders writers always tend to use males for the meaningless roles. That’s because even in real life, most mundane jobs and jobs requiring physical prowess tend to be done by males(there are, of course notable exceptions.)
Still, I think it’s completely based on the author. They could just as easily use female guards and make it seem like it’s not a big deal via their writing. In the end, the author holds the reins, but they mostly always tend to steer towards something resembling real life; which in turn leads to the mindset of giving males mundane stuff.