Your idea of making him work in the center with “relief” at the rail was a good choice, but start small, on line. Ask him to walk on the rail with you on the inside using a dressage whip or carrot stick to gently encourage him to walk on the rail. Allow him to circle around you, disengage his hindquarters, change directions frequently. Keep his feet moving! Make Visits “to the Rail” short and using your voice to relay that you are happy with his choice to go there. It may be an emotional thing for him, it could be a form of confinement fear, horses are claustrophobic at times, the rail may be just enough to be causing this for him. Can you ride him other places? A pasture, a field? Horses don’t enjoy boredom anymore than we do, while they will gravitate to familiar things, most horses welcome a new challenge as long as it does not involve horse eating fences lol Parelli Natural Horsemanship has helped me with my horsemanship immensely.