If a juvenile who has been taken into custody is not released under s. 938.20, a hearing to determine whether to continue to hold the juvenile in custody under the criteria of ss. 938.205 to 938.209 (1) shall be conducted by the court within 24 hours after the end of the day on which the decision to hold the juvenile was made, excluding Saturdays, Sundays, and legal holidays. By the time of the hearing a petition under s. 938.25 or a request for a change in placement under s. 938.357, a request for a revision of the dispositional order under s. 938.363, or a request for an extension of a dispositional order under s. 938.365 shall be filed, except that no petition or request need be filed if a juvenile is taken into custody under s. 938.19 (1) (b) or (d) 2., 6., or 7. or if the juvenile is a runaway from another state, in which case a written statement of the reasons for holding a juvenile in custody shall be substituted if the petition is not filed. If no hearing has been held within 24 hours or if no petition, request, or statement has been filed at the time of the hearing, the juvenile shall be released except as provided in par. (b). The court shall grant a rehearing upon request of a parent not present at the hearing for good cause shown.