Step 1: Note what stays fixed after disconnecting the battery.
With the battery removed, the charge $Q$ on the plates has nowhere to go, so it stays constant while the capacitance changes when the slab goes in.
Step 2: Write the energy directly in terms of the changing quantity. \[ U = \frac{Q^2}{2C} \] Since $Q$ is fixed and inserting a dielectric of constant $K \gt 1$ raises $C$ to $KC_0$: \[ U' = \frac{Q^2}{2(KC_0)} = \frac{U_0}{K} \]
Step 3: Compare the two energies.
Because $K \gt 1$, dividing by $K$ makes the new energy smaller than the original. \[ \boxed{U' \lt U_0 \ \Rightarrow\ \text{Energy decreases}} \]