If it with the same bank and a new card - either because of expiration or fraud - it is the same account and the refund will be applied. (As a bank rep explained it to me when I had a refund coming with a new card due to fraud, "We figure anyone who stole the information is not going to be putting money ON the account.")
If the account is closed and you no longer have an account with that bank, they should issue a check to you. I also had that happen with money that went back to an old account. The bank contacted me - I think by mail - to verify my address and sent a check.
As another poster learned, it is best not to tell them that the card is cancelled because then they will say you have to jump through all kinds of hoops because the assumption when someone says that a card was cancelled is that the person is just wanting it as a check and so they want proof that it is closed.