I finally have an answer to this. I wanted to make pillars for my roller coaster track, and I needed them to be vertical as well and after a lot of search found the solution. Here is how it looks
The way is to NOT use Array Modifier/Curve Modifer but instead parent the object (fence posts) to your curve ( Ctrl P), and then use DupliFrames (after disabling speed). This way, it treats each of your posts as separate objects and then you can use Limit Rotation to zero degrees on all axes. This will keep them vertical.
I just implemented this and it totally worked. Let me know if you need more details. I think the idea is that modifiers treat the set of fence posts as a single object and thus you cannot Limit Rotation on them separately. Using DupliFrames treats them as separate objects and thus you can limit their rotations afterwards. Sorry for the wordy reply without any images. Other blender experts can comment if this should work.