There are many meanings and uses for both of these prepositions, some logical, some idiomatic.
In the uses you ask about, I think the following meanings are most helpful
The first meaning in the COED for in is
expressing the situation of something that is or appears to be enclosed or surrounded by something else:
In that same reference, at is defined as
expressing location or arrival in a particular place or position:
Both in and at are used to denote location, and the choice of which may be logical, but is often idiomatic. In the street but at the corner of Hollywood and Vine.
However in can be used non-geographically to convey being a part of something (in an organization), as well as literally in the middle of something (in a crowd). The preposition at is much more specifically physically locational (although it has other meanings relating to time and measurement).
In your examples, Department and Faculty convey a group or organization of which the subject is a part, rather than a physical location. As such,when used with Faculty, in seems better, and at would jar (at least in US usage). Department is a bit less clear, perhaps because it is often associated with a particular location. Either could be used, but I think in would be strongly favored, again in US usage.
He works in the Department of Defense [yes].
He works at the Department of Defense [yes].
He works in the History Department [yes].
He works at the History Department [perhaps].
He is enrolled at the History Department [no].
University, on the other hand, is both an organization and a physical place. While both in and at seem correct, I would probably favor at, if for no other reason than avoiding repetition.