How would residents of Central Slovakia in 1880s travel to northern departure points like Hamburg in order to board Ships to the US ?
For travel in their immediate area, they'd walk. Ordinary people did a lot less long-distance travel then than nowadays.
For the journey to Hamburg, they'd use the railways. The Košice–Bohumín Railway would likely be the most local service, and opened in 1872. The Bratislava to Vienna line opened in 1848, and the Warsaw-Vienna line in 1845. Part-way along the line to Warsaw, at what is now Olderberg, one changes onto the William Railway for Berlin. From there, one takes the Berlin-Hamburg railway to Hamburg.