When the co-custodians of any child committed to custody under provisions of this chapter agree that such child is no longer in need of custody they may petition the court for a rescission of the commitment to custody. Upon the filing of such petition a hearing shall be held in open court and if the court finds that such petition should be granted it shall rescind the order of commitment to custody.