English, like other languages, has a morphological system of word formation that works separately from its syntactic system of phrase formation. In "nationally top-ranked", "top" and "ranked" are combined by a morphological process (compounding), while "nationally" and "top-ranked" are combined by a syntactic process (modification). By convention, we no not use hyphens between the parts of a phrase, but in compounds, which are made up of words, we sometimes do. For instance, you don't expect to see a hyphen added between a subject and its predicate, because that is a syntactic formation.
Inflectional endings are added to words by syntactic processes, not morphological ones, so they can usually not appear in compounds. The "-ly" ending of "nationally" is an inflectional ending, which we can tell from the fact that "-ly" never affects the stress or the internal phonology of a word that it is added to, and so that is a clue that the combination of "nationally" and "top-ranked" must be a syntactic formation, not a morphological one -- it contains an inflection.