Yeah. One time I was hitting this really popular rail and did a pretty basic trick that's been done a buncha times before on that same rail, and I got a ticket for $250 and cited for "failure to use searchbar".
just kidding. I had to try to be funny based on that other dudes joke but I failed. Of all the times I've been busted at handrails only once has their been a fine ($282 and criminal trespassing) but it was summer time and we were stepping on... and it was the day time.
Other than that, most cops are chill about it and would love to watch, but have to kick you out.