There's a comment there: "do not use overlay if linestyle is from the same rule (example: railway=tram)". Thus if a line and a linemod are specified in the same rule, the linemod will apply only if the line style is not applied.
I think the conditional application of linemod should be explicit in the rule somehow.