The Supreme Judicial Court or the Superior Court or any justice of either of said courts, on application of any person, may issue the writ of habeas corpus to bring before them any party alleged to be imprisoned or restrained of his liberty but not convicted and sentenced, who would be entitled to it on his own application, when from any cause he is incapable of making it.
14 M.R.S. § 5511