Refilling extra space between rail and posts for inserting screws?
The right solution is to trim the higher posts, which can be done with a simple hand saw. You could clamp some blocks on the posts below the cut to act as guides, keeping the cut square and preventing accidental damage due to slips.

The only acceptable alternative (to my mind) is a shim cut of a suitable material, such as wood with the grain oriented across the post. This is actually a more complex task. You haven't said what the dimensions of the gaps are or what finish you need to match, so I can't offer a more specific suggestion.