Well it can protect them, but Sauron isn't attacking Trunks by his empathic manipulation. It works like this
- Trunks sees Sauron
- Trunks is awed by Sauron's existence, causing him to be unable to make decisions or act outside of Sauron's likings
- This is not the result of an ability or effect of Sauron, simply his very existence and presence. It is the equivalent of someone seeing a beautiful painting and being in awe, unwilling to harm or destroy it, but the effect is simply far greater here.
Essentially Trunks isn't becoming a different person or being attacked, he is simply being literally awed into submission. The Keysword thus has no reason to protect him as he is still himself.
It would be like if Sauron was convincing Trunks to submit to him via brilliant argument, except it's instead by his very presence. For example one of the Elven cynics who went to Valinor went from being the most against the Valar to become the most devout of the Valar upon seeing their restricted forms for the first time. He was still himself, just with a change of mind.