I believe that, in some countries, government may refer to a particular elected administration. However, I will leave that to my colleagues who know better.
In the US, the term government is used to refer to both elected and career officals, as well as many public servants at virtually every level. Generally teachers, firefighters, police officers and others providing "street-level" services would probably not be referred to as the government (although they would be said to work for the government). However, the senior officials in their departments, and virtually all employees working in fedral and state agencies (labor, housing, military, transportation, etc.) would generally be considered part of the government.
Obviously, government also includes elected officals such as the executive (president, governor, mayor, town supervisor), as well as the legislature (congressperson, state legislator, city councilperson). Judges (both elected and appointed) would generally be considered part of the government.
Where there is a reference to the government taking an action, it depends on the context as to what part of government it means. In the phrase the government filed an appeal, the reference is generally to the executive branch of government and the court where the appeal is filed is seen as distinct (and hopefully, independent).