that CAN be used, but I would recommend doing this. The fastener will be the weakest joint of the union and the railing will not be as secure as you might want.
Consider, using a long bladed sawzall and cut the 4x4 down the center and then off, then do the same with the splice. Then dovetall or combine the two pieces with liquid nails and carriage bolts to gether. This will give you a much stronger union and a neat one at that.
If I need to clarify this, let me know, I will be happy to assist you.