Both signalling radio bearers are used to trans/receive lte signaling messages. SRB2 is used specifically for NAS signalling messages but if SRB2 is not at all present or established, SRB1 is used to trans/receive NAS messages.
SRB1 and SRB2 (optional) both are established at the time of attach procedure.
As soon as, the RRC connection setup procedure is finished UE and eNodeB both have SRB1 and once the RRC connection reconfiguration procedure is finished just after the RRC connection setup procedure, UE and eNodeB both may have SRB2.