Most of the time you will get told off and asked to leave. Sometimes the Police are called, most of the time they will just want you to leave. If you have anything on you that may be considered criminal, you may be arrested. So tools which may be seen as for breaking and entering, spray cans, drugs, etc.
Be polite and explain why you are there, accept that they're doing a job and you are in the wrong, and you should be ok.
If you are caught on Crown land, Government land, Police, Prisons, train lines, utilities, etc, you WILL be arrested and most probably prosecuted as these come under Criminal Trespass and not Civil Trespass.
Best advice is to not get caught though.