When one is searching for the lost property both of his father and of his teacher, his teacher’s loss takes precedence over that of his father since his father brought him only into the life of this world, whereas his teacher, who taught him wisdom [i.e., Torah], has brought him into the life of the World to Come. But if his father is no less a scholar than his teacher, then his father’s loss takes precedence…
If his father and his teacher are in captivity, he must first ransom his teacher, and only afterwards his father — unless his father is himself a scholar and then he must first ransom his father. (Bava Metsi’a 2:11)
[source: Jerusalemperspective.com]