I'm considering encasing the magnet assembly in polyurethane resin before inserting into the uniform to waterproof it.
That could work. There are at least two challenges with this. First, is that you need to make sure the magnet is sealed without any air pockets, otherwise condensation can occur and trigger rust. Second, the polyurethane needs to be thin enough so that it won't impede the magnetic strength. The magnet has to overcome the thickness of the coating plus whatever fabric barrier there exists between that and the metal.