Two men imprisoned under indefinite sentences for public protection were freed after serving about two decades.