Usually if you tell the conductor as soon as you get on, you can avoid a fine but you may have to pay a small fee (a few euro) to have it validated on the train. If the conductor comes to check your ticket and it's not validated, you may have to pay a fine.