Rat populations mostly aren't sustained by the sorts of trash cans that passersby toss garbage into (or fail to). They're sustained by containers carrying large amounts of residential refuse. (Consider the proportion of garbage you, personally, throw into a public trash can compared to your own trash can, especially food waste.) And I'm not well-versed on the specifics of Japanese waste processing, but I'm fairly confident they have something analogous to dumpsters and residential trash collection, even if they don't have public bins.
I don't know, there's a decent amount of rats where I live, but no outdoor dumpsters and very few public trashcans. Trash is kept indoors and brought out at the daily collection time.
I always assumed sewer access and the occasional rat-stronghold in poorly maintaned buildings was the issue.