You'll find on the Weapons Table that both Simple Weapons and Martial Weapons contain both melee and ranged categories. Thus, as long as a proficiency does not specify one or the other (for example, "simple melee weapons"), then you would gain proficiency in both melee and ranged weapons of that type.
Both the Fighter and the Ranger class descriptions list their weapon proficiencies as "simple weapons, martial weapons", so your point about the fighter being worded differently is unrelated. Furthermore, as both classes' proficiencies do not specify ONLY melee weapons, the proficiencies DO include ranged weapons in the simple and martial categories.
In addition, the reason it says "simple weapons, martial weapons" could be to exclude proficiency with any additional weapons that are not counted as "Simple" or "Martial".
For example, an improvised weapon may not be considered either if it, as described in the Improvised Weapons section of the Player's Handbook (p.147-148) "bears no resemblance to a weapon ...".
Lastly, the DMG mentions in its Firearms section on p.267:
It's up to you to decide whether a character has proficiency with a firearm. Characters in most D&D worlds wouldn't have such proficiency ...
Having proficiency described as "Simple Weapons, Martial Weapons" rather than "All Weapons" provides RAW for a character to not be proficient in a weapon of this nature.