The Tokyo Convention requires its Parties to ensure that they can exercise criminal jurisdiction over aircrafts registered under its flag.
Chapter II - Jurisdiction
Article 3
The State of registration of the aircraft is competent to exercise jurisdiction over offences and acts committed on board.
Each Contracting State shall take such measures as may be necessary to establish its jurisdiction as the State of registration
over offences committed on board aircraft registered in such State.
This Convention does not exclude any criminal jurisdiction exercised in accordance with national law.
It exists to prevent legal vacuum so someone is able to prosecute offences committed on board. It does not abrogate the extent of national laws otherwise applicable (though the exercise of such jurisdiction is limited when interfering with the operation of an international flight). So every state whose law claims jurisdiction has jurisdiction in that state's court. Usually the source of the claim can be classified in three ways, territorial (offences occurred on the territory, incl. airspace), quasi-territorial (offences occurred on registered aircrafts and ships), or personal (offences committed by or against nationals of a state). Extra-territorial or universal jurisdictions are also sometimes claimed but with less recognition by other states.
For the United States, a special aircraft jurisdiction applies to all flights registered under its flag and foreign aircrafts in the U.S. airspace, or foreign aircrafts that land in the U.S. whose next scheduled destination or last point departure is in the United States. The jurisdiction covers limited number of offences, mostly related to aircrafts e.g. hijacking or interference with flight personnel, and a number of serious crimes like murder and sexual abuses(see 49 U.S. Code § 46506).
The United Kingdom claims jurisdiction over offences committed in British airspace, or on British-controlled aircrafts (registered in the UK or owned or leased by a UK person) and certain foreign aircrafts that next land in the UK:
92 Application of criminal law to aircraft.
(1) Any act or omission taking place on board a British-controlled aircraft or (subject to subsection (1A) below) a foreign aircraft while in flight elsewhere than in or over the United Kingdom which, if taking place in, or in a part of, the United Kingdom, would constitute an offence under the law in force in, or in that part of, the United Kingdom shall constitute that offence; but this subsection shall not apply to any act or omission which is expressly or impliedly authorised by or under that law when taking place outside the United Kingdom.
(1A) Subsection (1) above shall only apply to an act or omission which takes place on board a foreign aircraft where—
- (a) the next landing of the aircraft is in the United Kingdom, and
- (b) in the case of an aircraft registered in a country other than the United Kingdom, the act or omission would, if taking place there, also constitute an offence under the law in force in that country.
Civil Aviation Act 1982
Thus in your case (United Airlines flight from the US to the UK), British courts have jurisdiction if sexual abuses are generally illegal in the US; and if the offence qualifies under chapter 109A of 18 U.S. Code, the US federal government can also exercise its jurisdiction.
As an example of personal jurisdictions that may be applicable, if the victim is a Chinese national and the alleged offence has a minimum sentence of three years, China can prosecute the case under its penal code due to personal jurisdiction, because its penal code said so. Whether China chooses to exercise this jurisdiction, or whether it can effectively exercise such jurisdiction (e.g. extradition if the accused is not in China), is another question. China also claims jurisdiction over offences committed by its nationals abroad (to provide a way for domestic prosecution since China does not extradite its own citizens).
Generally, precedence, preference of deference is given to territorial or quasi-territorial jurisdictions out of respect to another State's sovereignty.