You need Eac3to, and if want to convert to AAC you need the Nero AAC Encoder. If you don't already have it I've uploaded neroAacEnc.exe to FileFactory. Just extract the archive and place neroAacEnc.exe in the same folder as eac3to.exe.
Open the Spoiler and copy the contents into Notepad. Save the file as ConvertAudio.bat (or whatever you want to call it as long as it's saved as a .bat file.) Read the comments in the batch file and follow their instructions. You need to set the location of your eac3to, the format you wish to convert to, and the track numbers and desired bitrates for the audio tracks. Be sure to read extra included notes on how to deal with commentary audio tracks. When editing batch files be sure to right-click them and select "Edit", or else you're going to wind up executing it.
With that done, just drop the batch file into the same folder as your .mkv files and double-click it to run it. It will display detailed progress in a cmd window as it runs, ending with a "Press any key to continue..." message. The converted audio tracks will be placed in a "tracks" folder, ready to be dragged into MKVmerge for remuxing. Note that .m4a files are AAC audio and all tools will recognize them as such.
I originally wrote this to convert the audio for Raizel's encode of "High School DxD", so you will see it defaults with episodes 01 and 07 containing Commentary audio tracks.
Anybody who's done any scripting shouldn't have any difficulties using this. It's pretty straight forward. You don't need to know how to write scripts to change the settings to what you want.
As a note I just want to say, Windows scripting is the most horrid, disgusting, kludgy mess I've ever had the displeasure of working with. Something as basic as:
if ((x == 1) || (x == 7)) then...
is completely beyond it. Their idea of subroutines returning results is to put them into global variables. But then subroutines themselves are a hack. "exit /b" is how you return from subroutine?! Variable scopes are turned upside down inside nested layers, and they have all kinds of hacks for accommodating such things, but then they always manage to break something else. It's all just hack after hack, kludge on top of kludge. I've worked with many different scripting systems and programming languages over my extensive career, but have never before encountered anything as messy as Windows scripting.