Can’t answer the second part but I’d suggest some of the earliest documented sports teams would be the chariot racing teams of Ancient Greece and Rome. The wiki article refers to a team at the Olympics in 416BC.
In the United States, sports clubs arose from gentlemen’s clubs, which often fielded sporting sides, and I’m guessing that such a thing is related to school athletics, which probably developed in England and America more or less concurrently. Gentlemen’s clubs were strictly amateur originally, but over time, as they became more interested in competition and earning ticket sales, they started paying ringers under the table. Once clubs started traveling around to play clubs in other cities, it became very difficult to maintain even a facade of amateurism.
The “current practice of maintaining sports teams” could be said to have originated with the 1869 Cincinnati Red Stockings, which was the first openly all-professional baseball club.
Of course there were amateur (or allegedly amateur) baseball teams at least 25 years before that. You are right in tracing the evolution of formal teams back to the athletic clubs of the mid 19th century and early college teams. The origins of both can be traced to the 1840s.
Other have suggested chariot racing in ancient greece as a candidate for the oldest team sport (circa 680 BC). To that I say “Bah!”
Yes, but were the teams professionally organized over a significant period of time, or did they just scour town square looking for players whenever people wanted a game, organizing ad-hoc teams for that day depending on who was available?