What is the meaning of 教训 here？
It's 1, you might feel awkward or unfamiliar because:

When we take the meaning as 1,
we seldom says that someone teach others "教訓".

A more often way to use this meaning is to learn by someone itself.

Ex: 我從上次的失敗吸取教訓了，下次不會再犯同樣的錯。

I'v learned my mistake from last failure, and I won't make it again.