Under LHTR, in the description of AA guns, it does include a specific exception to AA guns ONLY moving in NCM when being carried on TRNs.
It is not 100% conclusive. But it is more than enough to make me think that the AA gun does indeed offload in COMBAT movement (but of course cannot “attack” so it is ignored as a unit for the attacker). If the Attacker wins the combat, they finish setting up the AA gun in NCM, and it protects the newly captured territory. If the attacker is thrown back into the sea, the defender gains the AA gun.
At least, that is how I read it…