The pillars / piers the gates were hung from are not fit for purpose and installing steel in them will have the same result. From what you described the piers relied on the walls they were attached to for stability which is completely contrary to any build or design methods I've encountered.
The piers / pillars need substantial foundations of their own *and* need a means of transferring the mass of the gates into those foundations via a reinforced triangular steel frame with hinge / hinges mounted to it. Another means of doing this is to have an upper hinge on the pillar and a "spud" in the ground to receive a pivot from the gate.