Section 26. The department, county commissioners or any city or town in which a draw for the passage of vessels through a bridge used as a way and maintained at the public expense is situated, whichever has control of said bridge, may make ordinances or by-laws regulating the passage of vessels through such draw, not inconsistent with the regulations of the United States on tide water bridges, and may affix penalties not exceeding fifty dollars for each violation thereof; but no such ordinance or by-law shall take effect until approved by the department.