As far as picking up either of them really goes, Guitar Hero's song selection generally leans towards picking harder songs, and Rock Band tries to emphasize on band balance.
I'd just reccomend you look at the setlist for Rock Band, Rock Band 2, GH3, GH:WT, and GH:5. It should also be noted that Rock Band drums will work with GH:WT and GH:5, but GH drums will not work nearly as well with RB.
Rock Band also boasts an impressively more diverse and numerous DLC option.
At the current, Rock Band has 693 songs available for download which are compatible for both games. Rock Band 1's setlist, sans three songs, is also exportable as "DLC" to Rock Band 2.
I can not find an exact number for Guitar Hero's DLC, because it's varied and they don't export well from game to game (IIRC, Guitar Hero 1-3 DLC, with the exception of the Death Magnetic album, do not transfer onto World Tour and on), and I can't find a direct number on Wikipedia, so I'd give it a tentative approximation of around 300. I've been told that World Tour has about 150 on its own and they just released about 50 for GH5, and I assume they released about 100 for Guitar Hero 3. There is also some portability of the GH:WT setlist into GH5 but I'm not sure to the extent.
----
It is important to note, however, that if you buy Guitar Hero you are feeding Activision. The same company that is going to release Band Hero in November.
This game will provide absolutely no new features.
It will, by all accounts, be an exact clone of a Guitar Hero game with a new setlist.
It is, and will only go down in history as, a multi-million dollar middle finger to Rock Band, which Activision seems keen on denying even exists.
----
And to clarify the difference in Guitar Hero: Metallica and The Beatles: Rock Band,
Guitar Hero: (Insert Band) games tend to have about 40% of the band it is named after and then the rest of it is bands that are similar to it or inspired/were inspired by that band.
(Insert Band): Rock Band, if it continues the same pattern, will consist of ~40-45 of the songs by that band and that band alone.
---
It really comes down to personal taste, though I tend to side with Rock Band if not only because of Activision's horrible spite and malice.