Well, you need to complete the task of creating a garrison first, and then free the heroes.
And also, pay closer attention to make sure that, in addition to the central hero and the 2 freed heroes, you don't have any other heroes.
If you bought any for other purposes, be sure to remove them. In other words, at the moment of freeing the 2nd "needed" hero, there should only be 2 heroes on the map (the central hero and 1 of the freed ones).
P.S. Death by hanging for the developers at Nival.