The issue is that, if I update PS1 in bashrc, I see that by default the cursor gets placed at column 0 instead of after the prompt, and if I type anything it starts overwriting the prompt. I tested the same PS1 string manually by deleting the bashrc file, starting a new session and typing in the PS1 string in the terminal and it worked just fine.
I found the answer to this problem but it took me an entire day and I didn't find the exact answer after googling a lot. The basic issue was with the bashrc file format. In my case the file was in DOS format with the two character end of line. The fix was to convert the file from DOS to UNIX format and it started working after that. I however don't know how exactly the file format caused the issue, it wouldn't work even if "PS1='XXX'" was the only thing in the entire file, without any new lines.
The following link gives information about how to convert the file: http://cs.nyu.edu/~yap/prog/cygwin/FAQs.html#bashrc