In all criminal cases where any person or persons are brought up on writs of habeas corpus before a judge of any court of record, it shall be the duty of such attorney to attend upon the hearing of such application on behalf of the state.
§ 56.080, RSMo