There are 3 tram lines in this city. The trams themselves come in all forms and shapes. Line number 3 takes you to the fortress. You will have to get off at the end of the line.
The train timetable was not convenient for us, that's why we took a bus to Daugavpils. The journey takes 4 hours and on the way there, there was a stop but not on the way back.