I would argue that this is a false dichotomy. I do not believe that we can say that federal bureaucrats are acting either in the interests of the government or in the interests of their agencies. I would argue that they believe that they are acting in the interests of both the government as a whole and their specific agencies.
People who work for a given agency tend to come to believe very strongly in the mission of that agency. They come to be very committed to that mission and they will act in what they see as the interests of that mission. People do not go to work for the Environmental Protection Agency, for example, if they believe that the government should not be regulating businesses in order to protect the environment. Therefore, they will really believe in that mission and will want to act in its interests. In that sense, you could argue that the bureaucrats work in the interests of their agencies, not in the interests of the government.
But these bureaucrats will typically believe that they are also working for the benefit of the government. They believe in their missions to the degree that they think that what they are doing is good for the country and for the government. They do believe that their actions are only good for their agencies.
Thus, I would argue that bureaucrats tend to act in the interests of their agencies, but they do so in part because they think they are also acting in the interests of the government and the country as a whole.