After upgrading to version 3.1, all moderators appeared in all subforums.
I see that this is because all of my moderators are super-moderators.
If anybody else has this problem, in Forum.php, change:
WHERE xf_moderator.is_super_moderator = '1'
to:
WHERE xf_moderator.is_super_moderator = '1' and 1=2
That way, only moderators of that specific subforum will show in the moderator list.