There are many correct answers to this problem. Still, all involve double layering or combining a question about the kind of person being addressed with a question about the information being sought. One solution is to ask this question: "If I were to ask you whether the right branch leads to the ruins, would you say 'yes'?"
If the villager is a truth-teller, he will reply "yes" if and only if the right branch leads to the ruins. Now let us see what the liar says. If the right branch leads to the ruins, he would say "no" if asked whether the right branch leads to the ruins.
Therefore, the truthful answer to your complicated question is "no." Since he always lies, he will reply "yes." On the other hand, if the right branch does not lead to the ruins, then he would say "yes'' if asked whether the right branch leads to the ruins; and so the truthful answer to your question is "yes"; therefore, he will reply "no." Note that in both cases, he gives the same answer to your question as the truth-teller; namely, he says "yes" if and only if the right branch leads to the ruins