The closest you can get by train is Vietri sul Mare, the last town on the coast before Salerno. From Naples you can take a local train to Sorrento, then either a bus or a ferry to Positano. Or you could take a ferry from Naples to Sorrento, followed by either another ferry to Positano or a bus.