That is why it is better for the barbarian to snap the wrist of the one guard, so that you can ask them a question still or you ask the first guard which way to the castle then rip his head off followed by asking the second guard if the first guard is dead. You will get the question from each guard and know which one tells the truth.
This still doesn’t accomplish the goal of knowing which door will kill you. All you’ve done is determine which guard is the liar.
That is why it is better for the barbarian to snap the wrist of the one guard, so that you can ask them a question still or you ask the first guard which way to the castle then rip his head off followed by asking the second guard if the first guard is dead. You will get the question from each guard and know which one tells the truth.