A 23-year-old environmental protester who brought traffic to a standstill last month has been berated by a magistrate.