Can the Ronin use its ability when defending?
Yes.

Root rules are very literal. They even say in the FAQ section:


  Q3. It seems like something should happen, but the
  rule doesn’t tell me to do that thing. What do I do?
  
  A3. Follow the literal word of the Law, not your instinct.


Here is the latest version of the rules as of the time of writing.

So in the rules "defending" only ever mentioned in the battle context, which indicates to me, that there could be no "defending" while not in battle. And since we just established that we are, in fact, in battle when the Ronin is defending, the rule should apply.

After rolling here is intended to convey that you are allowed to see the roll result before you decide whether to use the ability, not to imply any kind of agency. That would be too far fetched for the very literal style of the rules.

Here is what section E.8.2 has to say about the Ronin rule:


  Special Action: Swift Strike. You may exhaust a  to deal an extra hit in battle (after rolling).


Note, how "after rolling" moved to the end of the sentence, compared to the card, and how it is in italic now.

The overal battle rules are given in section 4.3. 

Some "while defending" rules to compare with your case are given in 8.2.2, 10.1, 10.2.3, 13.2.5, but I admit they are not very relevant here.