I'm not sure how/why you figure that, or how it's at all relevant.
I'm not sure how/why you figure that because "over capacity" != "will build new prisons / hire new guards". I.e., it's not at all impossible for there to be prisons that are over-capacity and also a decline in the number of prison guard jobs.
It's not relevant because the entire point of unions is to counter-act the effect of supply/demand dynamics on labor (see: "there's always another scab"). Just because there's "no shortage of work for the prison guards" doesn't mean they will lobby against changes to laws that might one day create such a shortage.