Officer is merely someone who holds an office, but generally it means someone who has been tasked with protecting or policing something, like policemen and women you might see on the street.
Official refers to anyone who is in a position of authority, generally a high ranking individual. Sometimes the meaning of the two can overlap, such as at the scene of a crime as you mentioned where police officers and police officials who administer over them are at the scene.
Technically, the words are synonyms for each other, but in common speech they are used in specific ways that you learn by experience. e.g. chief executive officer rather than chief executive official, or sports officials rather than sports officers.