The cost of the prosecution under the provisions of this chapter, and all other costs necessarily incurred in superintending and protecting such burying grounds or cemeteries, shall be a charge upon the owners, for the time being, of the tracts of land of which such grounds were formerly a part, and shall be collected as other costs in actions for trespass.