What is the best battery configuration for a solar powered electric fence setup?
How often would you expect your fence to go off?  Do the cows tend to stay clear after sampling or would it be expected that a large number of animals would periodically sample the fence?  Measuring your no-load power consumption and clarifying whether the solar panels are the only source of power or a supplement wouldn't hurt if you want the best possible answer.

I have two solar panels: SunWize SW-85P; 85W max power, 5.1A, 16.7V.
I have a charge controller: SOLAR BOOST 2000E.
I have four 12V batteries: two Interstate SRM-24 (couple years old), two CarQuest DP27M (new).
I have a fence energizer: Speedrite 3000 w/ 12V DC power adapter.
What is the best arrangement of batteries for this system? Since the batteries are 12V and the fence energizer requires 12V input, I believe that there is no series arrangement of batteries that is possible. However, what parallel arrangement is best? And in particular, which specific battery terminals should be connected to what?

You may not use those panels in series with that charge controller, nor the batteries, so you will be connecting your panels in parallel + to PV+ and - to PV- and if they will be exposed to differing levels of light (not in the same location or same direction) you should diode protect the panels to prevent them from becoming loads if diodes are not included in them.  Whatever batteries you use will be connected in parallel, and that set connected to the charge controller + to BATTERY+ via an inline 30A fuse and - to BATTERY-.
As far as the batteries to use, you must equalize batteries before you parallel them, meaning connect them with a resistance and allow the voltages to equalize before removing the resistance and connecting them with a low resistance connection.  After this the batteries can be charged and discharged as a group.  If you are going to parallel them they must be matching chemistry, and lead acid are probably the most tolerant to using unmatched batteries, so long as none of the batteries have failed.  That said, best results typically come from matched batteries, so it may be worthwhile to have the older pair reconditioned if you intend to have them matched with the new pair.
If there is no additional line voltage charge available, the power of the solar panels will probably matter more than the size of the battery bank, as the battery bank must simply be sufficient to power the load during the time between charges.
As far as the solar panels, really put some thought into their arrangement.  You want them to stay cool, to be hit by the brightest, most perpendicular possible light for the longest period of time possible.  Having a shadow on part of the panel can be almost as bad as over the whole panel depending on the series/parallel arrangement of cells inside, so take nearby poles, trees, mountains into account.  Depending on your longitude and latitude you should be able to find information on the best direction(NESW) and angle to put your panels at.  If you end up mounting panels high up, put some thought in at the start about how you will maintain them.  If they're on a pole in a forest/clearing, consider if there is anything you need to add to the pole so that when you need to clean the panels you can safely do so with a ladder without having to uninstall or bring down the panels.