You can only have one student account, pretty much every banks T&C's prohibit it (inc. Santander). If they did find out they'd either warn you, or give you notice that they're closing your account.
Answering the question at hand - both! It's absolutely fine to close the Santander account once you get the railcard code. I opened my Santander account on Wednesday (transfer from 123 Mini to 123 Student), transferred in £500.01 from another account and transferred it straight back out minutes later - yesterday I received the railcard code and today I had the overdraft increase.
I'll now give it a month or two before closing the Santander account and opening a student account with HSBC to get the £60 Amazon voucher.
You could do it the other way around if you wanted too (HSBC -> Santander).