In motorcycle terms, the sweep is the rider last in line whose job is to ensure everyone else in the group ride arrives at the destination safely. The sweep is often the person with the most experience, not always the fastest, but certainly with a reliable motorcycle who is not going to be the person who breaks down or crashes themselves. Having at least a basic amount of mechanical experience and tools is a plus so field repairs may be made if necessary.
Sometimes, the sweep function is performed by a truck or other vehicle that may also have a trailer. This is usually for very long trips that cover many miles on the highway as on twisty backroads the pickup and trailer may not be able to maintain the same speeds as the motorcycles. When this is done, the term "chase vehicle" is usually the preferred term, though the function is essentially the same.
"Riding sweep" is the act of performing the sweep function, as in, "I'll be riding sweep for today's ride." In Australia and some other countries, the "Sweep" is instead called "Tail End Charlie" which performs exactly the same job as a "Sweep".