I would call the first image a railing, or a handrail.
a fencelike barrier composed of one or more horizontal rails supported by widely spaced uprights; balustrade.
a rail serving as a support or guard at the side of a stairway, platform, etc.
The second one, I would call it a rack, or a bike rack. It could also be called a stand.
A bicycle parking rack, usually shortened to bike rack and also called a bicycle stand, is a device to which bicycles can be securely attached for parking purposes.