If you fancy somewhere more 'pubby' at Bath Spa, go out the back of the station, across the Halfpenny footbridge, left onto Widcombe parade, and go in the Ram (or the Ring o'Bells or the White Hart, although they're a lot less earthy!). Going out of the front of the station, it's a surprisingly long way until you hit anywhere good, mind you central Bath is tiny so everywhere's within 15 minutes walk.
Elsewhere - has anyone mentioned The South Western at St Denys?
Brighton - there are about a thousand pubs right outside the station, but I'd recommend the Evening Star or the Prince Albert, which is down the end of the tunnel under the front of the station.