Hi. It indicates they have been working in department for twenty years.
Another examples. "Say to him it went in one ear and out the other." The building on the other street is very old. When I was in, I was afraid of the walls. They seemed to come apart.
I disagree: the above-mentioned grammatical function belongs to the "on."
"In" in this case probably means the same as "cash in," such as "cash in a check." When cashing in a check, you get money; when cashing in on the force, you get experience and prestige.