I assume this took place in Washington state. There are a number of self-defense provisions in Washington law. The first, RCW 9A.16.110, is primarily about reimbursements for prosecutions of acts of self-defense, but includes an applicable limit on prosecution:
No person in the state shall be placed in legal jeopardy of any kind
whatsoever for protecting by any reasonable means necessary, himself
or herself, his or her family, or his or her real or personal
property, or for coming to the aid of another who is in imminent
danger of or the victim of assault, robbery, kidnapping, arson,
burglary, rape, murder, or any other violent crime as defined in RCW
9.94A.030.
This provision is relevant, since executing a prisoner on death row is not a crime (the state Supreme Court recently struck down the death penalty, so I assume this took place before that ruling).
RCW 9A.16.020 states the more classic law on justified use of force, saying
The use, attempt, or offer to use force upon or toward the person of
another is not unlawful in the following cases:...(3) Whenever used by
a party about to be injured, or by another lawfully aiding him or her,
in preventing or attempting to prevent an offense against his or her
person, or a malicious trespass, or other malicious interference with
real or personal property lawfully in his or her possession, in case
the force is not more than is necessary;
Statutory law does not define offense against his or her person. Grabbing a person and strapping them down for some harmful purpose would normally constitute battery under the common law, but in this instance it is privileged, so it is not an offense against the person).
RCW 9A.16.030 says that
Homicide is excusable when committed by accident or misfortune in
doing any lawful act by lawful means, without criminal negligence, or
without any unlawful intent.
The person is under court order to be executed, and it is not lawful to resist that order. The guard, however, RCW 9A.16.040, may use deadly force pursuant to the legal mandate to carry out the court orde ((1)(b)"to overcome actual resistance to the execution of the legal process, mandate, or order of a court or officer, or in the discharge of a legal duty").