Amphibious assaults can be done in two steps, consisting of a sea battle and a land battle. In your example, both the cruiser and the transport would attack the destroyer. If the attackers win, the transport can offload and the land battle will occur. If the transport ends up retreating (or being sunk), the land battle will not occur and the transport may not offload.