Wood filler for rotten top of post
Use a high-performance 2-part wood filler. It's like automotive body filler but sets a little slower and is easy to plane/form/sand smooth after it sets. This is one brand that I like but there are many brands out there:



I use a "cheese grater" style plane (Surform) to get it flat, then sand smooth. Works great for repair work when replacement of damaged wood is impracticable.