After the Dons dominated the opening stages of the game, Hearts broke the deadlock in 20 minutes when Matthew King took advantage of a poor kick out by David Hutton to find the net.
The Tynecastle outfit doubled their advantage eight minutes after the break when Berra headed home after a corner.
To complete a bad day for Neil Cooper's side, Richard Buckley was red carded for violent conduct after 73 minutes.