+1 on the construction adhesive like liquid nails. I would also see if you can "toe nail" it at the top to the board above. I would screw it though and not nail it. Personally I would not drill the brick. There is no going back on that one.
My opinion is that adhesive by itself will be a temporary fix. I would use screws made for brick. Tapcon screws to be specific. You don’t need big ones and maybe a couple at the top along with the adhesive will do the job. You will need a masonry bit as well if you don’t have one.
Set your trim and drill thru that to mark your hole on the brick then drill the brick. Return the trim board to position and attach. If the screw head is not flush then drill a bigger hole the same width and depth as the screw head so as to countersink it.