Questions:
Is there a non-stop train from Madrid to Paris?
Is there an overnight train with berth to sleep?
What is approximate cost and how early to make reservation?
You should fly. There is no non-stop or overnight train on that route.
No and no. You would need to change somewhere along the way. There are direct trains from Madrid to Marseille and from Paris to Barcelona. Both cities that are worth a night or two if you want to stop somewhere on the way.
Indeed, flying is better on this route.
A 2hr flight at ~ half the cost of a a 10-12 hr train journey.
I know what I would choose