Section 11. Whoever violates an ordinance or by-law prohibiting persons from riding or driving at a rate of speed inconsistent with public safety or convenience may be arrested without a warrant by an officer authorized to make arrests and kept in custody not more than twenty-four hours, Sunday excepted; and within such time he shall be brought before a proper magistrate and proceeded against according to law.