Whether it's better to attack or defend depends much on the composition of your army and the enemy's. If you have long range missile units (and plenty of them) but the enemy doesn't, then you should attack - this leaves them with the choise betwen sitting still and being shot dead, or charging your lines (effectively making you the defender vs their attack). This might fail if the terrain allows them to deploy on a high hill. If you are playing on huge unit size though, then onagers can cause massive destruction to an army camping on a hill.