"Betjent" as a noun would refer to police usually. I think there may be some uses where "officials" of various kind use the word "betjent" in their title, e.g. Kirkebetjent (an officer of the church? or perhaps rather a servant of the church?) but they would rarely use "betjent" alone then as important context would be lost. Technically I suppose "Politibetjent" is the correct title for officers of the law.
For a military officer one would use the word "Officer" in Danish as well.
It is an interesting comparison with the German "Bedienter" that oppikoppi points out, since the root of this is to denote "one that serves" in some capacity or other.