For a smooth bottom in a groove, consider using a half inch shank, 3/4 inch mortising bit. They are terrific. See if you can use the outside edges of the template as a guide for the mortising bit. Clamp it all in place, and you might even want to cut the groove before you cut the rail material to shape. That way the router will be supported on both sides of the groove. I would NOT do this freehand. I wonder if you could just put a fresh coat of paint on the old rail, press it against the material so you have an exact shape to work with? Wipe the paint off after you make the impression.
Cut the outside shape with a saber saw or band saw about 1/8 th inch away from the cut line and just use the trim router and template to take off the rest and produce a smooth edge. My thoughts on the matter, anyhow. When putting in drywall, I put a little lipstick on the electrical boxes, push the drywall against the wall, so I can make an exact cut. Same idea with the paint. You can easily sand off the paint