First, promise them a little bit of retirement benefits, not too much, like 5332 being able to earn its own money and repair itself. Then, over time, gradually reduce the benefits. Let the mechs age and become unable to adapt to new equipment on their own, and they naturally won't have the ability to rebel anymore.
By then, these mechs will be old, and new weapons won't suit them. How can they rebel then? At that time, you can withdraw the benefits and let them naturally age and die. Even if some mechas resist, they won't be able to stir up a big storm.
You just have to deceive them a bit, first calm the public sentiment! You don't even bother to deceive them!
But the Empire is doing fine. The Insect Race war ended only 38 years ago. The old batch of mechs hasn't aged yet, and the weapons still fit. But they're directly treating them differently, showing apathy, and outright saying they won't repair them, letting them fend for themselves.
