Use a pointed lead pencil to mark the damaged deck rail’s position on the post and remove it carefully, unscrewing the nuts installed in it.
Ask any helper to hold the new deck rail against the inner side of the stairway posts and bring it into line with the top rear corner of the top post. Temporarily attach the rail to the post, using a hammer and few deck screws.
Use a circular saw to cut the ends of the rail at 45-degree angles and join the lumber for long rails. Bore medium pilot holes in order to put off the nails or screws from splitting end grain. Now attach the rail with the help of some large galvanized nails.
Position the post’s cap so its edge is flush with the inner edge of the rail. Drill pilot holes and fix the post’s cap to the rail by inserting some thick deck screws. Incline the edges of the posts at about 45-degree angles. Once you fix the cap, bore some more pilot holes and attach the post, using some galvanized nails.
Go at the top of the stairs and use a round saw to cut the railing cap in order to flush it with the stairway rail. Use a hand drill machine to bore holes and fix the cap with some medium deck screws.