I have done flags like this before sometime ago. I used lollipop sticks (looks like what this person used too) and made my flag, then attached one end of the flag to the stick. I rolled that end onto the stick very carefully and before my fondant started to dry, so it wouldnt crack on me.
The rails, I cant tell if they are bought or made bc of the view of the pic. But, you could make them too. Just roll out your gumpaste and make 2 small logs and then add the post rails (middle) onto it and let them dry for a day or 2 and then attach to yr cake using royal icing or chocolate.