I use two thin steel putty knives.
I carefully tap the first putty knife blade under the rail until it contacts the nail closest to the edge.
Then I tap the second putty knife blade under the first.
If the two blades provided enough force to move the nail then I'll pull out the putty knives and grab the nail head with a pliers or old dull side cutters and pull it out.
If the two putty knives don't move the nail sufficiently then I'll drive a medium sized flat blade screwdriver between the putty knives until the screwdriver touches the nail, and twist if needed. The outer putty knife blade protects the rail and the inner one protects the wood by distributing the pressure more evenly.
Put a glued toothpick or a wood sliver in the nail holes once you've removed the nails.
Get new nails from PBR.