Actually, Long Branch onward. The good thing about Long Branch is service from NY is at least hourly electric service. Beyond Long Branch, diesel service usually involving change at Long Branch and usually less frequent, once every two hours or worse. In all cases the Beaches are about a half mile walk. Back when I lived in Monmouth County in Ocean Township, I would have avoided walking through Asbury Park. I don't know how it is now. If you are going South of Long Branch, might as well go all the way to Point Pleasant Beach or Bay Head. Nice beaches down that way.
From Penn Station NY, the LIRR Babylon/Montauk South Shore Line also presents many beach opportunities, though the really good beaches on barrier islands are quite a hike and may involve jumping on a ferry.