I checked again: first, I captured an additional Elven town, then the right Demon town, and then the left one. Both tasks were completed, and the passage behind the Dwarf garrison opened. Then I did the same thing, but captured the Demon towns in a different order - and it still worked! What sequence of actions did you perform? :)
Ment, JonnyP, did you encounter this problem?