In the poem Crossing Brooklyn Ferry by Walt Whitman, it seems to me the narrator is crossing a passage with a ferry. But doesn't the title literally mean he is crossing the ferry itself?
Walt Whitman wrote in the 19th century, when "crossing the ferry" was a more common phrase than either "crossing by the ferry" or "crossing on the ferry".
Why does this make sense? In the 19th century, ferry meant not only the boat, but also the place on the river where you crossed using the boat.
From Webster's International Dictionary, 1892:
A place, also a boat, for transporting passengers or freight over a river, etc.
OED sense 2 (“Now somewhat rare”):
A crossing over a river or other stretch of water which is served by a ferry boat. Also: a place at which a ferry boat departs or lands.
In sum, especially in older usage, ferry could refer to the stretch of water traversed by the boat (and its passengers) as well as to the boat itself.
Ferries in the old days were often not so much a boat as a raft pulled across the water by a rope attached at each end to opposite shores. In these cases, the ferry includes the rope and by extension the route travelled by the raft as it's towed along the rope. Therefore "crossing a ferry" had a meaning very similar to "crossing a bridge", i.e. "following a guided route across the water".