You can discard after battle if Joab is captured but it's not because Joab is in play. As soon as Joab enters battle and activates you are able to discard no matter what happens to Joab as long as he isn't negated. The reason this is different than other similar cards is that whats important in this kind of situation is whether the target of the ability is in play. Other characters with after battle affects often do something to themselves in which case they need to still be in play. Joab targets a warrior EC and thus can do so no matter where Joab himself is.