Jerusalem Talmud, Berachot 5:1

Whoever is occupied with community needs, it is as if he is occupied with the study of Torah.