Two beach towns, one railway line — ride south past Prachuap's karst bays to where the coast goes properly quiet.
Find a room before you go.
Every southbound train from Hua Hin stops at Ban Krut, and the line hugs the coast most of the way — limestone hills, salt pans and glimpses of the Gulf. It's a short, cheap, pretty ride that needs no planning beyond checking the three daily departure times.

Affiliate link. If you book through it we earn a commission, at no extra cost to you.
Pick any southbound service that lists Ban Krut. Second class is plenty for this hop; sit on the left side going south for the sea views.
Phetkasem Road all the way, with the Khao Sam Roi Yot national park turn-off making an easy half-day detour. Ban Krut's beach road is 10 km east of the highway.
Southbound buses drop you on Highway 4 at the Ban Krut junction, 10 km from the beach. Doable, but the train is simpler and nicer.
Step-by-step transport guides for this stretch of the Gulf coast.