@mitu, I'll check the script but to me the fact that the source code of ES refers to the buttons by two different names is incorrect.
Emulationstation works with more than 1 type of controller and/or keyboard. The fact that it works fine for a lot of other people contradicts your observation.
Anyway, I have to say that I didn't download the full package at first. I mean I only downloaded the source code of ES to compile, then when I realised I missed the themes I installed the configuration script. I need to do more testing though.
If you didn't install the package correctly, then you'll get incorrect results. Install the package from the RetroPie-Setup package - the stable version - then re-configure your controller and see if the .cfg file is correctly generated.