Added 4 minutes later
Although, wait a minute!
Added 8 minutes later
<...> your names in the report could easily be swapped.
I just got lucky; if the archers had fired before the ballista, then <...>
The 40% bonus gives machines initiative during battle, i.e., it will shoot more often, but this has nothing to do with the initial positioning in the lineup.
And it fired first because of the dwarven battlefield; I think the racial field gives the owner +0.25 to the initial positioning (I read about this on the Nival forum).
Added 52 seconds later
Although, I'm still a noob :(