What's the best way to finish this trim
Abutting moldings are often resolved with transition blocks. You could make a rectangular piece, slightly wider than the current gap.  Trim back the angled cap  so that it is flush with the vertical line at the end of the stairs. Trim back the base molding a bit. Make the block a bit taller than the end of the cap. 

The ideal thickness would be different from all that abut it. Reveals (intentional offsets in thickness) are easier than trying to get exact flush matches. And they are usually better looking.