If not, where were they during the battle?
Many shows and movies make a show of military leaders leading the charge. Leading by example would have to be weighed against protecting the leadership.
Speaking for ancient Greece only - yes they did. It was due to a combination of Homeric ideals, leadership style, and the morale of the troops. I wrote more about this here.