Will a horizontal 2x4x16 sag with only compressive force on it?
Yes, it will sag. I'd guess anywhere from 1-3 inches over time, depending on the moisture content and grain. 

Whether it's still able to resist compressive forces isn't dependent on that, though. It'll fail laterally (on the thin dimension) before it'll fail vertically due to sag. You should use a T configuration or a heavier (or metal) rail.