I have searched thoroughly on this but in vain.
My issue is I have written the AutoIT script which works perfectly when its executed outside the C# or Java code.
The script is:
IWebElement browse = driver.FindElement(By.Id("browse"));
Okay, So some how I found the solution my self. I still don't know what is causing the failure. The way its working is I executed the AutoIT script 2 times in my code. The first time dialog opens up and quits as mentioned above but the second time the script is executed the file gets uploaded successfully.