I am out of ideas on how to fasten this rail butting up to the wall. I don't think that using a bracket would give it enough strength if someone were to lean on it as its span is 6 feet and so there's a lot of torque. (Besides, a bracket would look ugly.) There is plenty of lumber behind the drywall (two sheets of 3/4 plywood) so there would be plenty of bite for a screw.
2 Answers
Any type of anchor/bracket at one end is not enough, unless there is more support along the length/other end. Six feet makes a good lever.
With good wood behind, a couple of good size screws driven into both sides should hold.
A bracket either under or on the outside will give more holding power. Brass brackets should look decent with that wood.
If you have good wood behind that drywall and don't want a visible bracket, I'd say that's a good use for a pocket screw.
Picture is of a random pocket-hole kit from the Internet, but they all use the same principles. The hole is drilled at a 15-degree angle to the joint with a dual-diameter drill bit, then a screw is inserted into the large hole, passing through the smaller hole into the wood. Fill what's left with either dowel finished to match or wood putty.