Troop Modules carry soldiers to guard your airship against enemy boarding attempts. Some modules also enable boarding actions against enemy airships. There are currently four troop modules in the game, three of which providing their own unique units.
The Guard Barracks is a 3x1 module that houses four guards. It can be placed in both ships and buildings. Guards possess basic combat capability, but are unable to board enemy ships; they are an exclusively defensive unit.
The Guard Post is a 1x1 module that acts as garrison for a single combat unit. This offers the player more control over internal troop deployment. Guard posts can be quite effective when placed near crucial parts of the ship, such as the bridge or cargo hatch, improving response time to enemy boarding actions.
Note: Do not think of a guard post as a miniature barracks as it does not actually add a guard. A guard post simply tells an existing guard to stand at its location. If no barracks exist, the guard post will remain empty; further, guards from guard barracks tend to prioritize critical infrastructure (bridge, engines/lift, weapons) rather than the guard post. This module is generally not useful when using Guards.
The Marine Barracks is a 3x2 module that houses eight air marines—soldiers that can board enemy ships (via jumping to the other ship) or repel enemy boarders. They will either spawn at their barracks or at critical parts of the ships, such as weapon modules, bridges, and suspendium chambers. If you're planning on boarding enemy ships, you'll usually want two or more barracks' worth of Marines available; for defending your own ships, a guard barracks is generally more effective.
The Grenadier Barracks is a 3x2 module that houses four grenadiers—elite soldiers that excel at boarding enemy ships. Grenadiers carry grappling hooks which allow them to board ships more safely and from much further away, giving them a leg up over standard marines. Grenadiers are also much more dangerous than standard marines, although they are much more pricey.
If you capture a pirate boarding craft, you'll find that pirates get 6 of their grappling-hook boarders for the same module space that you get 4. If you plan on boarding enemy airships routinely, it's probably worth farming pirates for their craft and, by extension, their modules.