In Texas[0]:
(c) The use of force to resist an arrest or search is justified:
(1) if, before the actor offers any resistance, the
peace officer (or person acting at his direction) uses
or attempts to use greater force than necessary to make
the arrest or search; and
(2) when and to the degree the actor reasonably believes
the force is immediately necessary to protect himself
against the peace officer's (or other person's) use or
attempted use of greater force than necessary.
Elsewhere: Sec. 9.33. DEFENSE OF THIRD PERSON. A person is
justified in using force or deadly force against
another to protect a third person if:
(1) under the circumstances as the actor reasonably
believes them to be, the actor would be justified under
Section 9.31 or 9.32 in using force or deadly force to
protect himself against the unlawful force or unlawful
deadly force he reasonably believes to be threatening the
third person he seeks to protect; and
(2) the actor reasonably believes that his intervention
is immediately necessary to protect the third person.
Assuming you survive the encounter, it is possible you could prevail on your day in court.[0] https://statutes.capitol.texas.gov/Docs/PE/htm/PE.9.htm#C