The audio in your AVI would not be AC3 as TMPGenc would not be able to encode it anyway. Most DivX have the audio as a stereo MP3 made from a down mix of the original DD AC3 from the DVD, if its a DVD rip.
To improve or retain the audio quality, I would try this. Rip the audio out of the AVI with VirtualDUB as a WAV, then use BeSweep to convert the WAV to MPA (or MP2). Test this audio and if okay, mutiplex this audio track with the Video track from your original conversion. Should be better. Let me how it goes.