Glue only holds if it is applied to sound surfaces. The project area must be free of dust, grease and old glue. It is invariably necessary to entirely remove the loose rung from its receiver -- the hole in the leg into which it fits -- to do this. Have an associate hold the bottoms of the two legs that the rung passes between; this maximizes the leverage. Gently press the legs apart until there is just enough clearance to pull one end of the loose rung free. Twist the rung as you pull the other end from the receiver in the opposite leg. Allow the legs to relax back to their normal positions.
If a rung is broken, rather than simply loose, take it with you to a home improvement warehouse or hardware store and purchase a matching replacement. In the case of vintage furniture or if a specialty wood or design must be matched, consult a company that manufactures bespoke replacements; you may need to mail the broken rung to the company so it can make a perfect copy.
Carefully use a dull knife to flick away as much of the pre-existing glue as possible. Remove it from the ends of the rung and from the inside of the receivers. Use sandpaper or a proprietary adhesive remover to clean away any difficult patches. Wipe both the rung and the receivers with mineral spirits to ensure they are free of any contaminants. Let the wood dry.
Squeeze proprietary wood glue into the receivers. Normally, not much glue is needed; the ends of the rung fill up the holes, so use only enough to entirely coat the surfaces. Have your associate pry the legs apart again, once more extending them only as far as is necessary for you to slip one end of the rung into one receiver, then the other. Release the legs and use a sash clamp or a piece of rope tourniquet-style to pull the legs tightly together and hold them in position until the glue dries; the instructions on the packaging will tell you how long this should take.
Use a damp rag to wipe away every trace of extruded wood glue from around both ends of the rung. Wood glue is water-soluble until it sets.