I've seen this feature from time to time on both commercial and residential buildings exhibiting some form of colonial-style architecture. It's essentially a fence on top of a roof. Does this feature have an official name?
noun a low protective wall along the edge of a roof, bridge, or balcony. "she stood on the bridge, leaning over the parapet to watch the water race by"
This is a definition from Google. There are likely to be stricter definitions in architecture than in literature or military usage, for example.
Widow's Walk and Captain's walk are terms that have been used for a certain type of lookout platform, but I believe that refers to the entire area, not the railing or barrier itself.
If it was a proper area where people could walk, then the fence would be a Handrail, or Balustrade, or a Railing, and it would be a Balcony or Tower, or a Lookout. If there was a roof over the standing area, then it could also be a Porch.
This assumes there's a doorway or some other convenient access, that isn't "climbing up the outside with a ladder" to get there. If the only access is for maintenance purposes, then that's decorative only.