There are several options, here are a few of them.
From Miami, if you’re not renting a car, there are several bus options that service Marathon.
Greyhound services Marathon from many locations in Florida, including MIA — and from MIA to Marathon is approximately 3 hours.
Miami-Dade MTA has the Dade-Monroe Express (Route 301) that leaves from Florida City and arrives at Marathon in approximately 2 hours.
There are also a few shuttle services, including Keys Shuttle and Lower Keys Shuttle