The air units that are on an aircraft carrier participate in the defense, they are not considered cargo. On page 20 of the rulebook under Order of Play.
Air Units: A given air unit may participate in the sea combat or the land combat portion of the amphibious assault; it may not do both. The attacking player must declare the air units involved in the land and sea combats and cannot change their assignments later. Attacking air units, whether involved in the sea or land combat, may retreat
according to the normal rules. Defending fighters on aircraft carriers can defend only in the sea combat. Defending air units in a territory can defend only in the land combat.
And in the Appendix (page 30) under Aircraft Carrier, or (page 27) under Fighter the example image.
The Sinking of a Defending Carrier: The attacking Japanese submarine sinks the U.K. carrier, then submerges after the defenders Fire. Both the U.S. and U.K. Fighters can Fly 1 space to safety. They can land at New Zealand (a friendly territory), or on the U.S. carrier (a friendly carrier). Otherwise they are destroyed.
Fighter Defense: Whenever a carrier is attacked, its fighters (even those belonging to friendly powers) are considered to be defending in the air and can be chosen as casualties rather than the carrier. (However, a fighter can’t be chosen as a casualty from a submarine hit, because submarines can attack only sea units. See Submarines, on page 32.)
and from the online FAQ:
If my fighters are on an ally's carrier, when do they move and fight?
Your fighters move along with the carrier when it moves. They can't fly out to attack on your ally's turn, but they fight normally if the carrier's sea zone is attacked. If the carrier moves into an enemy sea zone to attack, however, your fighters can't be part of the attack but they can be taken as losses, if you agree to sacrifice them.