IRCTC puts a block on tickets for certain period the moment a form filling is done till transaction is completed. So if your friend is completed filling the form and then moved to transaction page, IRCTC may have blocked the tickets for him. Even though you have completed transactions faster than him, but the block was already in place for your friend.