Entropy as extractable useful work vs. statistical entropy Statistical (Boltzmann) entropy of a (thermodynamic) system is defined as

(The logarithm of) the amount of microstates corresponding to the (thermodynamic) macrostate of the system.

So, in way of the standard example, a system consisting of two connected heat reservoirs in thermal equilibrium has higher thermodynamic entropy than any other distribution of the same total heat energy among the reservoirs.
On the other hand, thermodynamic (Clausius) entropy I have heard to describe

The amount of useful work that can be extracted by a system.

This, to my current intuition, seems to contradict (in fact, invert) the above scenario, as thermodynamic equilibrium is the sole macrostate where no useful work can be extracted from the system whereas any different (lower statistical entropy) distribution where one reservoir is hotter than the other allows for some work to be extracted.
Therefore, my intuition must be wrong. Please point out the mistake(s).
My background is pure mathematics and information theory, only very little physics.
(Another angle: Szilard's engine seems to match my intuition. A bit of mutual information between the world state and my model of it ("knowledge"), which is (statistical) negentropy, can be used to extract work.)
 A: The maximum work $W_{max}$ that can be gained in a thermodynamic cycle  from a thermal energy source that is at temperature $T_2$ by extracting in each cycle an amount of entropy $S$ and delivering it to a thermal energy sink at temperature $T_1$ is $W_{max} = S(T_2-T_1)$. This is Carnot's theorem although he used the term calorique and not Clausius who did not like that word and instead introduced the term  entropy. If you wish, this is the operational meaning of entropy. The thermal energy extracted from the the reservoir is $ST_2$ while the thermal energy delivered to the sink is at least $ST_1$. It is exactly $ST_1$ if the process is reversible.
By cycle is meant a process in which the engine that converts thermal energy is operating in a periodic fashion meaning that all its thermodynamic parameters are periodic functions with the same period.
Almost anything that intuitively you would associate with the naïve concept of heat is what could be called "calorique", ie., entropy, except for being conserved for that would be energy. It is conserved only in a reversible cycle because the thermal energy dumped in the sink is $ST_1$,  in other words the same amount of entropy $S$ is extracted at $T_2$ as it is dumped at $T_1$.
Nothing here said has anything to do with statistical mechanics although using other results following, such as Gibbs and Helmholtz potentials, etc., one can associate terms and behaviors in a statistical manner.
A: Since you invited corrections I will correct one misstatement in your question:

thermodynamic (Clausius) entropy I have heard to describe [as] the amount of useful work that can be extracted by a system.

No, this is the definition of free energy. Entropy is associated with the amount of work that cannot be extracted. Mathematically,
$$F = E - T S $$
where $F$ is free energy, $E$ is total energy, $S$ is entropy and $T$ is temperature. In Information-Theoretical terms, $S$ represents incomplete knowledge of the state of the system that prevents us from fully recovering the work.
A: I just realized one possible way to resolve the seeming contradiction:
Statistical entropy of a system is the amount of Shannon information one can extract from the system, which in turn can be used to extract work (e.g. Szilard's engine).
So,

the amount of useful work that can be extracted from a system

would then really mean

the amount of useful work that could be extracted from a system with full knowledge of its precise microstate

which seems rather unpractical (since you wouldn't have this knowledge) and surprising to me, especially considering that the connection between information and heat wasn't yet understood at Clausius' time (publicly, at least). But it would resolve the thing.
