Nut &bolt or nail for railing construction
You always want railings to be very strong. Folks seem to have a natural trust of railing, and you don't want to break that trust. When somebody leans against your railing, you don't want the railing to give way and allow the person to fall.

Depending on the design of the railing, you'll want to use bolts and/or screws wherever possible. Nails will pull out far more easily than either screws or bolts.