Component of force in the direction of displacement should be taken.
Work is measured by the product of the applied force and the displacement of the body in the direction of the force
Work $=$ Force $\times$ displacement
$W=(F \cos \theta) \times \Delta s$
Given, $W=25\, J, F=5\, N, \Delta s=10 \,m$
$\therefore \cos \theta=\frac{W}{F \cdot \Delta s}$
$=\frac{25}{5 \times 10}=\frac{1}{2}$
$\Rightarrow \theta=\cos ^{-1}\left(\frac{1}{2}\right)=60^{\circ}$
Hence, angle between force and direction of body is $60^{\circ}$.