I found this answer by John Rennie (in the question you see the train on a track):
when the train moves a distance $d$ the work done on the train is $Fd\cos\theta$. It's certainly true that the horse is exertiong a force $F$ that is greater than the force on the train,... The dot product is defined as: $ \vec{F}\cdot\vec{d} = Fd\cos\phi $, where $F$ and $d$ are the magnitudes of the vectors and $\phi$ is the angle between the vectors. In our case the angle $\phi$ between the vectors is $\pi - \theta$, so $$ W_{horse} = Fd\cos(\pi-\theta) = > -Fd\cos\theta = -W_{train} $$ the work done by the horse is equal to the work done on the train. So no mechanical energy is being wasted by pulling at an angle.
However this overlooks the fact that muscles are inefficient things and consume energy even when no mechanical work is being done. This does indeed mean the horse will use more energy to pull the train at an angle, but this is just down to way muscles work rather than fundamental physics. To calculate the extra energy the horse uses you'd have to go off and ask a biologist about muscle physiology.
in which the fact that "(...it's certainly true that the horse is exerting a force F that is greater than the force on the train)" F is greater than the net force $F>F\cos\theta =F_{net}$ is attributed to the way muscles work.
I am aware that mechanical work is the product $F_{net}\cdot d$, but, if we substitute the horse with a defined mechanical force, the result is the same and we cannot attribute the cause to muscles.
Also, we know how to use freebody diagrams and calculate net force subtracting opposing forces, why doesn't he consider the opposing force exerted by stiction (track: $F_{stiction} = F \sin\theta$) what in the original sketch is defined as nonworking reactive power) and say that the wasted energy (the force/work on the track) can be easily determined, even if this is not mechanical work?
Also, if a steel ball A ($J = k, Ke = E) hits another identical steel ball B it does work (on B), if it its a wall Wand this doesn't budge, it does no work on (on W), but why we cannot conclude that exactly same E was lost/wasted on the wall?