My assembly of vinyl tracks, drive sproket, idler wheels, and road wheels will vary from model to model depending on several factors. One of the first things I check is the "stiffness" of the track. More than once, I have broken loose ider, road, or guide wheels when trying to attach an overly stiff track.
If the track is overly stiff, I will expore ways of leaving the drive spocket, idler wheel or even road wheels unattached until the very end of the build. For example, on my Tiger I builds, I have left the drive sproket unattached. Once the tank is completely build and painted, I loop the pre-painted track around the idler and through all the roadwheels then hook the drive sprocket into the front of the track and gently pull it to it's mounting hole.
It's about a 50-50 split on my builds between painting the wheels before or after assembly. Much of this depends on how much of the wheels are visible on the finished model, how much weathering I'm going to apply, and the ease (or lack of ease) in painting the assembled road wheels.
Tracks are almost always pre-painted. Thus far, I have always pre-painted vinyl tracks and pre-painted indi tracks 1 out of 2 times. The one set of Fruil tracks I've used so far were also pre-painted.
I have had some flaking of paint on vinyl track during assembly and like others have stated above, always use acrylic paints as a base coat after thoroughly washing the tracks. However, I think it's far easier to apply a few spots of "touch-up" than to try and paint the tracks completely after assembly on the model.
Good luck and have fun!