Neither difficulty nor defense will influence missile effectivenes, only the armour and shield values do. Phalangites generally are well-armoured have increased shield values to simulate the deflective abilities of their formation. They are somewhat lower in defense than similarly trained and equiped troops, though, but that does not influence the current situation.

Also, javelins are rather weak in EB: historically they were more an irritative weapon than a killing one. Frontal javelin attacks at phalanxes are not very effective: you have to get to their unshielded side or their back in order to do serious damage, and even then don't expect a single unit of peltasts to be able to cripple a phalanx unit,