When the prisoner is lawfully imprisoned or restrained or is not entitled to be released on bail, he or she shall be remanded to the person from whose custody he or she was taken or to such other person or officer as by law is authorized to detain him or her.
12 V.S.A. § 3974