Scribe, saw and pare until you get a good fit, fix in place. It really is about as simple as that. Remember the tight fit only has to be right at the edge, it can be undercut away from the edge and won't make any difference — which based on the third photo it appears is how the original is done.
But this joint doesn't have to be done this way. You can cut away the moulded edge from the horizontal member and simply cut the end of the vertical piece straight across and butt it into the space! Flexible fillers have made this sort of joint more acceptable in painted work than in the past where tight edge-to-surface joints (coped joints) were more standard.