I have also noticed that in most of your examples the agent is not the teacher, but the students. So the verb 'to engage' means 'to become interested' in your examples, right?
In a sense, yes, that's right, but you can understand the word better as having a basic sense of 'locking into something'. Here are three ways to show this basic sense:
1) When I used to play rugby, the referee would shout "Engage!", whereupon each team would lock itself into the other to form the scrum. One team engages with another. The two teams engage.
2) In a set of gears, when one cog interlocks another, we say the gears have engaged.
3) Before marriage, a couple is engaged when they become locked into a marriage betrothal.
You can see that the verb can be used in two ways:
a) A engages with B
b) A and B engage.
(An exception to the use of
with is when talking about marriage, where we say
engaged to.)
As for 'to engage someone in an activity', it means 'to make someone take part in an activity with great interest', is that right?
Basically, yes.
Still, some vague points for me remain. You are right, I am not quite aware of the difference between 'to engage with the task' and 'to engage in an activity'
I hope I've answered your question about the use of
engage with above. As for
engage in an activity, I think the best way of understanding this is that the PP 'in an activity' expresses the
context of the engagement rather than the thing they're interlocking with. So if students are engaged in the lesson or engaged in your brilliant activity, they are not so much interlocking with the lesson or the activity itself, but rather with the particular task, or speaking partner, or problem, or whatever it is that forms the context. Another way to put this is with the expression 'engage with someone in a fight'. The fight is the context.
So as for your final question, I suggest you say
The teacher engaged the students in the activity (not
with) because the activity is the context, not the thing they're interlocking with.