I mean, maybe they should have been? Just comparing apples to apples (it takes X amount of COBOL code to the same thing that Y office jobs would have done), maintaining the office job over a long period of time might be easier than finding and retaining COBOL engineers, because you get more active practice at it—people naturally want to streamline their work, new people always have to be onboarded, etc. I don't think things are ever so clear-cut apples-to-apples though—there are things you can do with COBOL that you couldn't feasibly do with any number of office workers, and there are things you can do with office workers that even the best COBOL probably isn't going to handle well.
No no no you can’t replace the COBOL because then the COBOL programmers won’t have jobs. Perhaps the government should offer a basic amount of support for its citizens so that this isn’t a problem.