That would be a matter for a court to determine. Had they merely given him a ticket for tresspassing it would have gone to trial possibility we would have seen what CA law says about the requirement to show papers. We may still since I would imagine he was charge or more typically charged with resisting etc to try to get him to plead out.
If the police witness the trespass, and the perp doesn't follow orders, they can remove him or arrest him. They don't need the involvemment of a court.