From the food perspective - both cities offer delicious food at dirt cheap prices, but IMHO Tallinn has an even better food scene than Riga, especially if you want to do some fine-dining. Tallinn also has a lovely Xmas market right on its medieval Town Hall Square.
I like both Riga and Tallinn (as well as Vilnius, as others mentioned); both have quite different and equally appealing architecture to enjoy. But personally, I slightly prefer Tallinn for its medieval look and the superior restaurant scene, and I have now been back twice without getting sick of it. I feel that Riga is better in the summer (it was a bit "dead" when I visited in winter), while Tallinn feels lively all year.
To maximise my time when travelling in the Baltics, I usually choose to fly between the Baltic cities using Air Baltic (the Latvian national carrier). If you look out for their sales, it can be as cheap as 19 Euro (plus a fee for check-in luggage) from e.g. Riga to Tallinn, and just a quick 1hr flight. Both airports easily and quickly accessible to/from their respective city centres, for a cheap cab fare.
Since you're interested in good food, as I am, I thought I would pass on this guide which I've used in the past:
White Guide | The best restaurants in the Nordics
It's like the Michelin Guide of the Nordics/Baltics and I've found it to be very reliable in selecting good restaurants while travelling around the region!