piece. If it is only bent, just bend it back. Every once in a while I have a deer bump itself against my pool fence in panic and get caught between two pieces... I have to bend them back.
If the root is rotten then it is another matter. You have to replace them.
Watch this video how to mount rail post on brick:
the price is about 100 dollar per side, and probable 4 hours for both sides labor time.