Birke Yosef (OC 284) holds that when two people have otherwise equal obligation/right to an aliya to the Torah, but one is a talmid chacham, then the other gets the aliya. One of his arguments is that a talmid chacham can study in the merit of the deceased, whereas the other fellow has no merit comparable to an aliya.
Nit'e Gavriel (Avelus volume 2, chapter 74 ("Priority in [Leading] Prayer and Aliyos"), section 8) implies that Birke Yosef's rule applies also to leading the services: when a talmid chacham and another have equal obligation to lead the services, the non-talmid chacham does so, and for the reason outlined above.
Now, the Birke Yosef's view is not commonly accepted, as far as I can tell: Nit'e Gavriel himself lists it only as an alternate view (though he does imply some practice that way), and it's not cited anywhere else that I checked. Nonetheless:
From the Nit'e Gavriel's expansion (to leading the prayers) of the Birke Yosef it seems that studying Torah is, at the very least, as great a merit for the deceased as leading the services. (Otherwise, it seems unfair to prioritize the non-talmid chacham.) (One could argue that it's even greater, but that argument is weak.) So it seems according to this that there is no reason to miss a Torah class in order to lead the services.
Obviously, consult your rabbi for any practical ruling.