At face value, since you typically have way more melee than ranged creeps per lane, killing the melee building provides more benefit for future pushes. However, the ranged barracks has 10 less armor and will die faster.

When push comes to shove, often you don't really have a choice in which one to take down if most of your creeps are focused on one building over the other you will want to focus fire to take it down faster before the opposing heroes rush to defend. If you do have a choice, you should take out the melee barracks first to put more pressure on that lane with your creeps.

Reducing the bounty you provide for enemies is the most important task, and since there are more melee creeps per wave than ranged creeps, you'll want to focus the Melee Barracks.

It's pretty much impossible to judge a situation accurately enough to know that you'll have time to safely kill the Ranged Barracks (which has less armor) but not the Melee Barracks. If you can do that, you definitely don't need my help. Until that point: ALWAYS focus the melee barracks and ping/VOIP to make your allies do the same.