Section 59. The supreme judicial or superior court, by mandamus or other appropriate remedy, at law or in equity, upon the suit or petition of the attorney general or of the mayor, or of one or more taxable inhabitants of a city, town or district authorized by law to incur debt, or of any creditor to whom it is indebted to an amount not less than one thousand dollars, may compel such city, town or district, and its assessors, collectors, treasurers, commissioners of sinking funds and other proper officers, to conform to this chapter.