It seems like only post flags' declination counts towards the ban. Do declined comment flags also count towards the ban?
No, declined comment flags do not count toward flag bans.
As per the post announcing the current flag ban system:
Flags considered for the purpose of these warnings / bans are currently limited to post flags
Also, see this chat message from an employee (Shog9):
[You] don't get banned for comment flags
These are both confirmed by personal testing.
Note, however, that declined comment flags are considered when calculating your net helpful flag count to see how many flags you can cast daily, and will negatively impact it.
The flag ban requires that 10% of your handled post flags in a week be declined. Comment flags marked either helpful or declined have no bearing on the ban.
This is from personal experience - I've been in situations where if comment flags counted towards the ban I would have gotten flag-banned, and the other way around - if the helpful ones counted for not being banned I could have avoided a flag ban.
So comment flags aren't counted for the ban, but they are counted for both the Deputy / Marshal badges and the increased flag allowance per day the more helpful flags you've raised.