If you are on a quest then most likely you have a weapon of sorts. A bow/arrow is best but I suppose a sword would do. Attack one of the heads. If it tells the truth it will say "you shot me!" if it lies it will say "You didn't shoot me!". try with two heads and you should work out which is which.
http://www.giantitp.com/comics/oots0327.html