I got offers from both of them too, but I chose Edinburgh because I love living in a city. I know it, because I grew up in a city and at 16 I moved to a boarding school which is in the middle of nowhere (that is, North Yorkshire coast, somewhere among the sheep and cows) and it is kind of suffocating here.
I've heard that St Andrews is for people who like small, remote, romantic places.
Edinburgh is, well, a city. You get all kinds of stuff there, but it's a bit more... loud. Luckily not as loud as London.