If the rail is structurally okay, you can epoxy it in place. However, it is more likely that the rail is rusting out, and epoxying it will only make your problem worse. The best scenario is to replace the railing if it is rusted out, by pulling it, getting a coring company to drill a few holes for you as a "filler" job (something they do to fill a hole in their busy schedule) and then cast a new rail in its place.
Personally, I don't like wrought iron railings, because you have to maintain them, and they always seem to rust. You might explore your alternatives.