Quoted By:
West Germany's federal railway DB ran the last mainline steam service 1977 and then even outright banned steam engines until 1985. Including any potential preserved engines that were confined to non-federal railways for that time.
Many industrial lines kept running steam shunters though, the last convential steam engine in West Germany retiring 1992 according to Wikipedia. Fireless steam storage engines are actually in daily use in a handful of industrial plants until today.
East Germany's DR kept their steam engines running longer until 1988 to be more independent from oil imports. Even after that a couple were kept operating as spares and were even running in revenue service after the reunification until late 1994 under the then privatised DB.
Some East German narrow gauge lines had always been running steam trains until today, but gradually shifted their focus from actual service to a heritage line.