The bug
When theres not a raid or outside of the village area during raid, they will attack the villagers, players
and iron golems as normal, but when theres a raid happening, they appear not to attack at all.
(This doesn't affect to pillagers and evokers as they will still attack during raid)
Confirmed in 19w13b. And as you said, this only happens with vindicators and ravagers that are spawned within a raid. As for vindicator raiders, they don't seem to have an axe they could attack the villagers with, see MC-146981.