The end section of my front garden fence is over a sink hole and needs repair.

Here's the back of the fence showing the rail having come off the post nearest in the pic.

Rail broken off post
Plan:
1 - Remove pickets from upper and lower rails. Should be doable as they are nailed on
2 - Re measure lengths for upper and lower rails in their current sinked position. (Top is going to be longer than bottom)
3 - Buy treated pine and cut to measure to replace rails.
4 - Buy brackets similar to below to re-inforce rails in to the posts
5 - Attach brackets to posts and fix on rails in new position
6 - Screw on pickets to rails.

Questions/concerns:
1 - I am concerned about the rail attached at an angle from post to post as it won't be attached plumb, but I have no way of re-aligning the posts because they are now over a sinkhole.
2 - Should I fill the below recess on the left post and attach the new rails with brackets for this end? If so what type of bracket would work?

Thanks,
Ash.