Court system on 'brink of collapse', former senior judge warns