In your first scenario, the American planes participate in the defense of the sea zone and must be destroyed before the transports are automatically lost. However, since the Germans have subs in the battle, and since subs can’t hit planes, any hits by the subs must be taken on the transports.
If Germany only had subs left, and the UK force only had planes and transports left, then the transports would be automatically destroyed and the battle would end. But since Germany has units that can hit the planes and vice versa, the battle doesn’t end automatically. Basically, as long as there are units that can hit each other, the battle doesn’t end automatically.
For your second scenario, if the UK, at the end of a full round of combat, has only transports left, the UK may retreat those transports if there is a valid sea zone to retreat to. The transports may not unload.
Edit: if the UK player decides not to retreat, then Japan would roll its planes and the UK would take any hits on its transports. The UK would have the option to retreat after every round of battle where it has any surviving transports.