Recently, I have been trying my hand at rails.
This is overall your biggest problem. I've found that making contact to the rail with my snowboard works better than other parts of my body.
Committing is the biggest thing, in my opinion. You can't chicken out half way through. As another user suggested, make sure you can Ollie well. This may be better practiced on rollers in the terrain so you don't have to worry about clipping the rail.