You can use replicators to create older ship parts. at a bare minimum the ships would be useful as transport ships or science vessels.
The main reasons you would decommission a ship in today's world is due to maintinence and repair costs, parts availability and a change in propulsion technology. All of which gets answered by a replicator and the "working for fulfillment not wages" I get that there are a limited number of large overhaul depots in star trek, but if parts can be replicated and money doesn't exist as it does today, why not just keep a ship running forever?