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.