Apparently, and for purposes of rank progression, all your hired personnel count toward the soldier limit, including scientists (which are presumably assigned the rank of Rookie, since it seems that scientist promotion does not take place in Apocalypse). Therefore, it is possible to have only ranked (i.e. higher than Squaddie) Agents if the total staff limit was reached through hiring scientists to fill the ranks. Check the discussion on the Agent Ranks page for more information.
In Apocalypse, as far as promotions are concerned, all hired personnel count as soldiers. This includes Biochemists, Quantum Physicists, and Engineers, who register as Rookies. Therefore, it would theoretically be possible to have only ranked Agents, as long as the rest of the personnel are enough to support them. For example, it would be enough, in the third example above with 45 total soldiers, to have 32 scientists for all your field Agents to be ranked Squad Leaders or higher.
45 soldiers to get 1 captain + 3 sergeants + 9 squad leaders + 32 Squaddies/Rookies
I'm playing Apocalypse again. Having 20 Agents and 30 civilians I can't acquire captain. According to this I have 50 people that should give me captain rank with ease. So why I don't have one?