It really depends on what you mean by that.
For something to be a mortal sin, it has to be definitively willed. You have to do it and mean to do it. Now I do understand what you mean when you are talking about your head saying no but you still ending up doing it anyways sortof impulsively.
So for example, I can imagine a situation in which a person with a very short temper is in a disagreement with his mother and gets so angry he wants to tell her to go to Hell, and while he says no to it in his mind, almost at the same time the words come out of his mouth impulsively. I think every human being has experienced a situation where he isn’t sure why he’s doing something… where he chooses against it in his mind only to realize he’s doing the thing or said the thing or whatnot.
On the other hand, what about an action that takes longer than blurting out a phrase? What if a person were tempted to fornicate for example. Now I can imagine that he might say no in his mind, and find himself beginning to get frisky with his girlfriend. The big difference here is that from that time when he first might impulsivley touch her inappropriately or something to the time he’s actually forincated with her is a pretty lenghty process. That can’t be attributed to impulse. The first impulsive touch, certainly, but not anything much beyond that.
So if it was something like the first case, it may well not be a mortal sin. A person might impulsively do something for a brief instant even when he’s mentally rejecting the idea. If it continues beyond a brief impulse, though, then it clearly is a mortal sin if it is an action of grave matter.
The thing is, don’t ever take anything for granted. If it were a brief impulse, don’t dwell on it, but at the same time don’t ignore it. Tell God you’re sorry - say an act of contrition, or if you don’t feel sorry ask Him to make you sorry - and confess it next chance you get.
That’s ultimately the solution. Say you’re sorry to God either way. Tell Him - and mean it!

- that you’re sorry the action happened even if you aren’t at all guilty of it. If you live your life
that way, not wanting to do anything that even objectively offends God even if its not your fault, then you’ll be so much less likely to ever actually do something wrong that you
are guilty of.