Found it... What you saw as a former Santa Fe Spreader.
Sort of a bulldozer/road grader for trains, they can be used for plowing either snow, dirt or ballast. The wings can extend out, making a wider swath. The best known manufacturer of these units was Jordan, though I don't know who made this particular unit and there were other manufacturers. I'm not sure, but it's possible some railroads made their own as well.
Since they have a control cab for the wings and plow, they bear a vague resemblance to a locomotive.