At some point, you're going to have to perform the action "select all objects to..." whatever. It's going to happen.
You wouldn't even be able to set which layer those objects are visible in without selecting them first so to make life a bit easier, why not select all the parts of the railing and group them with Ctrl+g or join them together into one mesh (which isn't the end of the world as you'll see in a moment) with Ctrl+j.
If you need to select them all quickly, either use Ctrl+left click to lasso, b for box select or c to "paint" a selection with the circle select tool.
If you join all those parts together, then set the material to what you want it to be for all of them, you can perform a separate on "loose parts" by hitting p and selecting "loose parts". This means that each individual part will separate out into a new object, as it was before you joined them (provided the original meshes weren't broken into pieces before you started).
If you still don't fancy joining the mesh together (and personally, I would, especially as it's so easy to break them apart again) then once grouped (so you can reselect them easily to do this again if needs be by selecting one of the objects then hitting Shift+g and selecting "group"), do as ideasman42 said and link their materials together.
Dealing with lots of objects (or lots of verts/edges/faces for that matter) can be tricky at times, but there are tools to make it easier, joining, grouping, select similar etc.
Hope this helps.