Yes, you do get 5% cashback.
It is typically posted within 3 days.
Unless you are doing a time-sensitive booking (8 am, 10 am, 11 am) always, I repeat always, use HDFC SmartBuy with an HDFC CC/DC to buy train tickets. For months, they have not even been charging the CC surcharge that even IRCTC charges. The amount shown in the OTP is what is getting posted in the statement too.