Section 54. Whoever is found in a public way or other public place, committing any offence or disorder set forth in sections fifty-three and fifty-three A, may be apprehended by a sheriff, deputy sheriff, constable or police officer or by any other person by the order of a magistrate or any of said officers, without a warrant and be kept in custody for not more than twenty-four hours, Sundays and legal holidays excepted, until he can be taken before a court or trial justice having jurisdiction of such offence.