I tested it and you are right. HA indeed stand still and do nothing and javelineers use their javelins as melee weapon. This is also an issue in EDU 2.02.
However, I'd like to point out that I made an assumption and marked it by putting "I don't think" and "I guess", so although I was wrong, there's absolutely no need to shout.
The bug may be annoying, but who would send those HA with their swords to fight off elephants anyway... On the other hand, ere jav cav does very well against rajput elephant javelins; maybe even too well...