に with the original verb 乗る indicates the object you ride "bicycle, car, train, etc." by itself, it means (in) or (on) like (ride in a car or ride on a bicycle).
But first, I'd like to emphasize that this original verb 乗る takes the particles が and に, where が indicates the subject or the rider, and に indicates the object or the thing you'll be riding.
The expression "can do something" can be expressed in two forms. Depending on the form you use, the particles of the original verb either remain the same, or change. So, "can ride a bicycle" can be expressed in two ways:
When using the first form. The particles remain the same because the verb form remained the same "乗る". But as you can see in the second expression, the verb form changes. This is called the potential form of a verb. Its form forces the nouns in the sentence to take specific particles. The pattern is: (person) に (thing) が (verb in potential form).
Now, to express (cannot ride) as in your example, you can say:
If you use the second expression, like the one in your question, it's preferable to use が instead of に just to follow the rule of using the potential form of a verb. But if you want to use に, use the first expression.
Hope that helps.