You need to be specific on which Cog railroad trip you are referring to. The cog still runs coal fired steam trains for train buffs during off peak hours for rail fans, but the majority of the trips are driven by diesel electric locomotives disguised as the old steam locomotives. It is quite noticeable between the two, the diesel cogs sound like an diesel excavator climbing the mountain and the steam whistle sounds like a tractor trailer horn. The cog burns a blend of mostly diesel with some small percentage of biodiesel and they refer to burning "biodiesel"in their advertising. There is no legal definition that I am aware of as to what percentage constitutes "biodiesel" so its a legit claim but IMHO they should really advertise the cogs as running a "biodiesel blend. Unless they are doing it voluntarily, the engines are not EPA Tier 4 required of most on and off highway mobile equipment as railroad locomotives are specifically exempt and under their own lagging requirements. The EPA has proposed getting rid of the exemption
Regulations for Emissions from Locomotives | US EPA bit its being fought by the railroads as it would require replacement of most of the floot of locomotive and potentially increase fuel costs plus require DEF.
Tier 4 diesels are quite "clean" while I believe the cog is using an earlier standard, diesels inherently produce more NoX than gasoline engines and more PM 2.5 fine soot. If the EPA changes the rules I expect the Cog could convert to TIer 4 diesels, but the certification would be very expensive and difficult as there is not much demand for cog railroad engines.
From an emissions point of view, the diesel cogs are carrying a large car load of people up and down. I have not seen a study on per capita emissions generated between internal combustion engine cars going up the autoroad or and individual car driving up the cog, my guess is the cog has lower emissions per capita possibly by a large amount. The coal fired steam engines are a different story, they are going to create far more particulate emissions (thus the black cloud) and dependent on the source of coal, higher sulfur emissions both of which are non issues with modern gasoline engines. emissions per capita will be lot closer in this comparison but the emissions would be apple to oranges. I have been in the plume of the cog on occasions and "tasted" the sulfur int he air which I used to experience in industry so I expect the coal theya re burning has some percentage sulfur.
Ideally the cog would electrify the railroad and use regenerative braking on the way down. They probably have some regenerative braking in the diesel electric units they currently run but expect its limited. They could also adopt ancient technology used on the cable cars in San Francisco, where a car going downhill is effectively pulling another one up. Its a slight variation of a funicular.