Looking into the front of the cab windows, I see a large white space. The upper part of the white space appears shaped to indicate an arch in the opening back to the tender. If that white space is the background sky as seen above the train; then there is complete absence of any elements of a building standing behind the engine that might be mistaken for a doghouse atop the cab. The only way that could be a building behind the engine would be if it is standing on very thin legs that might not line up with the opening through the cab.
So as improbably as a makeshift doghouse atop the cab seems to be, I conclude that is what is shown.