In the case of a public utility or non profit organization that does not generate any profit, the value of a service is probably measured using its cost. Even though wages may account for the majority of the cost there are always material costs and overhead. I'm only referring to your example where you say the value of a service only includes wages.
You mention dividends and say they are not retained by the company. They are profit that is distributed to shareholders. What a company does with its profit is irrelevant to the discussion.
Price - Cost = Profit
My statement in the original post could only be true if all costs are derived from labor. I just spent a few minutes reading this reddit post on Marx's economic theory https://www.reddit.com/r/askphilosophy/s/pKHF2zltlj