These are supports for the city gate. These posts were probably made from tree trunks and were buried deep into the ground. The doors of the city gate were attached to these posts.
The bar was probably a heavy rod of iron that connected the gate to the posts. The doors of the city gate were probably made of heavy wooden beams or iron bars.