I asked Dave to get me my sweater from the other side of the yacht . While he was gone, I rested my arm on the rail over there and suddenly *it* gave way.

Do "it" and "rail" mean the same thing?
yes