The best way to learn to balance on rails is to keep your speed up, don't land on the rail too hard, look at the end of the rail and keep your shoulders parallel to the rail by keeping your chest closed. You can do these tricks to learn to do it but the only way to learn is to do it as many times as possible and don't be afraid of falling because worst case you'll bruise your hip and every skier has been there. Good luck on your rail journey I wish you luck.