Now you catch on. “Trolley” refers to the streetcars that predated buses and subways in major cities. To flounder around to the answer to a question or how to perform some sort of procedure and then to come up with the right answer was the equivalent of getting on a trolley that's on the right track (as in track of streetcar rails).