State lawmakers have approved legislation to help small, rural towns struggling to maintain their aging water and sewer systems.