I did some tests using cheat mode in a different game. I managed to duplicate the exact appearance of both the elephant and archer. The archer's damage is 6 (on a 0-10 scale). However, a major problem is that it's impossible to see whether the elephant has a damage of 9 or 10 because it is so big that it partially obscures its own shield. However, this could be determined by entering cheat mode, then edit unit and set hit points, this reveals the hit points left (I assume this would be cheating because it involves using cheat mode

). Another way is to hack one of the game files (I've forgotten which one) to change the elephant unit to have a leaner look (but I don't think this issue is important enough for such drastic measures).
Whether the elephant has a damage of 9 or 10 makes a huge difference:
Damage 9: 27 successful attacks, 23 unsuccessful ones.
Damage 10: No successful attack, 20 unsuccessful (and not even one of these attacks increased the archer's damage).
Conclusion: If the elephant's damage is 10 an attack fails. If the damage is 9 there is a roughly 50% chance of a successful attack.
So if I knew the elephant's damage was 9 I'd
probably attack (would depend on my mood though) beacuse the rewards of a successful attack are high.
If the barbarians get the chance to attack us (either because of an unsuccessful elephant attack or because we retreat the elephant) I agree that we should rush buy stuff so we have as little $$ left as possible but still more than $50.