Scottish Government 'failed to improve treatment of prisoner