The girl’s family does not have a car, prosecutors said, and public transit was not an option.

When Mr. Williams arrived, Ms. Singas said, he motioned for the girl to get in the front seat, which she did, and then began driving east through the city of Long Beach.

But at some point in Long Beach, Mr. Williams canceled the ride in the Uber app and began driving away from Merrick, westward, toward his home in Brooklyn, Ms. Singas said.

“When he cancels that route, the GPS turns off, and the ride is terminated,” she said. “For us, that’s sort of a consciousness of guilt. You know, he’s taking her somewhere that he’s not supposed to take her, and he cancels the route so we can’t see where he’s going.”

While driving, Mr. Williams told the girl that he wanted to take her drinking, Ms. Singas said. The teenager refused, repeatedly telling Mr. Williams her age. When it became clear that Mr. Williams was driving the wrong way, she requested that he take her home.

According to prosecutors, Mr. Williams declined. Because the girl was in the front seat, she was afraid to pull out her phone and call the police or text her parents in case Mr. Williams saw her, Ms. Singas said.

“She was scared, and she didn’t know how he would react to that,” she said.

Just after they crossed into Brooklyn, the girl told Mr. Williams she needed to use the bathroom, prosecutors said. He pulled the car over, and she ran into a McDonald’s on Linden Boulevard in East New York, where she called the police.

Mr. Williams followed her, prosecutors said, but fled before officers arrived at the restaurant, which Ms. Singas said was about 10 minutes from Mr. Williams’s home.