Partial answer valid for Italy. (See Edit 3 for more general info)
Disclaimer: I'm not a Lawyer, and Italian legislation is a real mess, so any expert in Italian Navigation Laws is welcome to chime in and provide improvements.
I'm going to cite several article of Italian Law, which are in Italian. I won't provide an accurate English translation because juridical translation is very tricky (I have friends that do that for a job and research: you have to match terms AND concepts, and it is not easy at all).
Instead, I will provide short, layman, interpretations of the cited articles, just to give the general gist of the thing.
First of all, before asking what happens to people restraining a passenger (crew or not) you must first establish the jurisdiction under which the plane falls. In Italy this falls under the Navigation Code (Codice della Navigazione).
Art.4 and Art.5 regulates which laws are applicable:
Art. 4 Navi e aeromobili italiani in località non soggette alla
sovranità di alcuno stato
Le navi italiane in alto mare e gli
aeromobili italiani in luogo o spazio non soggetto alla sovranità di
alcuno Stato sono considerati come territorio italiano.
Art. 5 Legge regolatrice degli atti compiuti a bordo di navi e di aeromobili in navigazione
- Gli atti ed i fatti compiuti a bordo di una nave o di un aeromobile nel corso della navigazione in luogo o spazio soggetto alla sovranità
di uno Stato estero sono regolati dalla legge nazionale della nave o
dell'aeromobile in tutti i casi nei quali, secondo le disposizioni
sull'applicazione delle leggi in generale, dovrebbe applicarsi la
legge del luogo dove l'atto è compiuto o il fatto è avvenuto.
- La disposizione del comma precedente si applica agli atti ed ai fatti compiuti a bordo di una nave o di un aeromobile di nazionalità
estera nel corso della navigazione in luogo o spazio soggetto alla
sovranità dello Stato italiano, sotto condizione di reciprocità da
parte dello Stato al quale la nave o l'aeromobile appartiene.
More or less these two states that, if the plane flies the Italian flag, then the its Italian territory if it's flying outside any Country's aerial space.
Otherwise, i.e. planes from other countries, fall under the jurisdiction of the country of "plane's flag", but if it's flying over a territory subjected to Italian sovereignty, this is applicable only if there is "legal reciprocity" between that Country and Italy.
Let's assume now, that we are talking about a plane under Italian jurisdiction.
Art.893:
Art. 893 Provvedimenti per la salvezza della spedizione
In corso di viaggio il comandante deve prendere i provvedimenti
necessari per la salvezza dell'aeromobile, dei passeggeri e del
carico.
states that the plane commander must take any necessary measures for the safety of the plane, passengers and load.
Art.1095:
Art. 1095 Inosservanza di ordine da parte di passeggero
Il passeggero, che non esegue un ordine concernente la sicurezza della
nave o dell'aeromobile, è punito con la reclusione fino a tre mesi
ovvero con la multa fino a lire duemila.
The passengers must obey orders (from the commander or the crew) concerning the safety of the plane. Otherwise they may be punished by the law with jail up to 3 months or a fine.
All the above and a bunch of other articles in that Code lead to the conclusion that the commander and their crew have some sort of obligation to carry out "police duty" on the aircraft (at least in some measure), especially when plane and passenger safety is at stake.
This alone would represent a "bonus" in a trial against them if accused of some crime related to the restraint of a passenger that put safety at risk.
For the exact measures the crew can enact, we must turn to the ordinary penal Law concerning self-defense.
Here is a somewhat scholarly article about self-defense law, complete with an historical and juridical analysis.
The core point is art.52 of Penal Code that states:
Non è punibile chi ha commesso il fatto per esservi stato costretto
dalla necessità di difendere un diritto proprio od altrui contro il
pericolo attuale di un’offesa ingiusta, sempre che la difesa sia
proporzionata all’offesa.
This deserves a somewhat literal translation:
[a perpetrator of an act] is not prosecutable if [the perp] was forced by necessity of defending a right of theirs or anothers against a clear and present danger of an unjust offense, as long as the defense is proportionate to the offense.
According to the gist of the analysis in the article, you cannot be criminally prosecuted for any act if all these conditions are met:
You act in defense of a right of yours or of another person's, e.g. the right to live or the right to own a thing.
The danger must be clear and present, i.e. highly probable. It's not enough to just believe or suspect something bad may happen.
The act is necessary, i.e. there are no other feasible ways to avoid the offense, e.g. by fleeing away from the danger.
The offense against which you defend against must be unjust. I.e., you can't cry for self-defense against a policeman trying to legally arrest you or you cannot claim self-defense in a brawl you actively joined.
The defensive act must be proportionate to the offense.
By deduction, then, restraining the problematic passenger in the way the OP showed could be allowed without consequences for the crew, but up to a point.
What I see as problematic is the tape on the mouth, since that could be deemed excessive in court. Once the passenger was duct-taped to the seat it was probably no longer a critical threat for the safety of the plane and/or other passengers. Taping her mouth probably was done to prevent her screaming and avoiding further discomfort to the passengers. But this latter is not probably "proportionate" to the threat and probably not even "necessary".
She could be fined for screaming, but gagging her is quite a drastic action against a whole host of her rights (and even dangerous if she has a condition of some sort), so she could have a point in court about that and the crew could be convicted of "eccesso di legittima difesa" (excessive self-defense) or even worse crimes, since they could have put her health at risk for no reason.
But, as I said at the beginning, IANAL, so anyone is welcome to improve my answer.
EDIT
To address a comment from StephenS:
The passenger was reportedly biting people, so taping her mouth
arguably qualifies as self-defense. Also, it could be argued that her
screaming would interfere with the crew’s duties to make various
safety announcements to the other passengers.
I'm not saying gagging her was unjustified, I say that it was probably not necessary nor proportionate according to Italian law viewpoint.
Once tied to the seat, biting was no longer a present danger, just keep people away from her. And the screaming interfering with safety procedures is not clear-cut. Maybe she could have been put in a different seat, somewhat isolated from other passengers. They could have shielded the noise using blankets hung near her seat. Whatever.
The point is, once a clear-cut necessity (clear AND present danger) is ruled-out, the only people that can decide if limiting a legal/civil right of a person is justified is a judge.
Notice that the Italian law makes a strong difference between "necessary" and "(reasonably) justifiable". "Necessary" means "You have no other (reasobably) viable alternative", not "that's the most convenient way to handle it justifiably".
Not even police can do that in Italy. Police here cannot even arrest you if you are not found committing a crime "in flagrante". They can only detain you at most for 48hrs for strong suspicion of grave crimes (or for identification purposes, if you cannot show them your ID card or other ID documents, like a passport or a visa), pending a judge to validates the detention (the judge must be notified as fast as possible in those 48hrs. The police cannot delay the notification at its discretion).
Moreover, we have a constitution article that prohibits any mandatory sanitary treatments, unless ordered by a judge and only if there is an explicit law that mandates the treatment. With the pandemic we had quite a debate about making vaccination obligatory, even for a limited group of persons, e.g. doctors and nurse, since the government CANNOT impose that. The parliament had to approve a special law to allow for that.
Articolo 32
La Repubblica tutela la salute come fondamentale diritto
dell'individuo e interesse della collettività, e garantisce cure
gratuite agli indigenti.
Nessuno può essere obbligato a un determinato trattamento sanitario se
non per disposizione di legge. La legge non può in nessun caso violare
i limiti imposti dal rispetto della persona umana.
Translation:
The Republic protects the health as a fundamental right of
the individual and interest of the community, and guarantees
free medical treatments to indigent people.
No one can be obliged to be submitted to a determined
sanitary treatment unless mandated by the law. The law
may not in any case violate the limits imposed by the
respect of human person.
Why is this relevant? Gagging her may be considered a mandatory sanitary treatment. I can definitely imagine her lawyers suing whoever gagged her for violation of constitutional rights or a prosecutor starting a crime investigation about that part.
Please, note that I'm not taking sides of the obnoxious passenger here, just trying to explain that Italy self-defense law is quite restrictive and its application is tricky.
EDIT 2
(To address some comments)
Here is a very relevant article I found on BBC site:
Who, What, Why: Is it legal to restrain air passengers?
It supports my points about the rules being fairly country-specific.
Some excerpts (emphasis mine):
So is the level of restraint shown in the photo - including gagging -
allowed by law?
A number of conventions - including the Tokyo Convention (1963) and
the Montreal Convention (1971) - address the issue of ensuring safety
and discipline on board a plane.
[...]
He says that while aviation is international by nature, there is no single over-riding convention regarding the treatment of unruly passengers.
Passengers' behaviour is subject to the laws of the country in which the plane is registered, says Healy-Pratt. And what the crew can and cannot do is also governed by the national laws of that country.
[...]
"Reasonable force can be used but if the crew go beyond that and unreasonably cause injury, they could be held responsible under the Montreal Convention," says Healy-Pratt.
This offers compensation "in the event of damage caused to passengers during international air transport".
Excessive restraint or gagging has the possibility to cause injury and even death.
What's described in this last sentence is what could, by Italian law, tip the scale toward "not proportionate", hence not "rightful self-defense".
Edit 3 (further research results)
Upon further research, I found that all EU states have committed to a new protocol that address the issue of unruly passengers. This a link from the EU parliament that states this.
Subject: 2014 Montreal Protocol, unruly passengers on board aircrafts, Commission's awareness campaign on safety
Answer in writing
Unruly behaviour on board aircraft has significantly increased over the past few years. The International Civil Aviation Organisation (ICAO) has identified ‘unruly’ passengers as a major issue for aviation since they endanger the safety of both passengers and crews. In 2014, ICAO states — including the 28 EU Member States — adopted the Montreal Protocol, which amends the 1963 Tokyo Convention on offenses and certain other acts committed on aircraft, and puts in place a stronger international legal framework to deal with unruly passengers. Given the importance of this new protocol to improving the safety on board aircraft, could the Commission provide an update on the status of its ratification within Member States? What is the Commission’s position on the protocol?
The problem with EU legislation, is that to be effective it must be ratified by each individual country.
Anyway, further investigation into ICAO website brought up this page (Current lists of parties to multilateral air law treaties ). If you scroll down, it reports that the Montreal protocol of 2014 is currently in force since 2020-01-01. There you find a link to a document listing all the countries that signed that protocol.
And this is a relevant document (a PDF slide collection) from IATA.
Regarding the first part of this answer, that document from ICAO doesn't mention Italy. So it seems that my considerations still stand.