The First-in-Command is the leader among the Gladers. This position seems to come with more responsibility than power. When decisions need to be made, the First-in-Command calls a Gathering, and leads the discussion. There seem to be two instances of teens with the role of First-in-Command in the books. Alby is the leader of the Gladers, being new to the job when Thomas arrives on the Glade, as he mentions their former leader, Nick, had recently died. Newt is his Second-in-Command and takes over the role of leader when Alby is unavailable. It seems that Harriet has the same role as Alby within Group B, with Sonya presumably being under her.
In The Scorch Trials Official Graphic Novel Prelude, which is canon within the movie series, Ximena had died similarly to Nick, which is how Harriet came to be the leader with Sonya as her Second-in-Command.