what do i need to do to win the "trail of mind" ?
or at least second place.
Train skills (mostly mind related), but most importantly - experiment and see what each interaction with each door does and plan your route accordingly. With stats high enough, you can breeze through the trial. Without correct stats, it is still very winnable, but you need to know exactly what you are doing.
You can get the first place with 30 in all stats if you do everything just right, but it will be tough. Second place should be very doable with your stats, but, again, you need to really know what to do. The first Trial should not generally be an easy thing to win for a jack of all trades character. That's alright though. You are not required to win every Trial to win the tournament, and definitely not to win the girls
Focus on increasing your intelligence or magical power around 80 points. I still recommend the first option, because it's more interesting than blowing up all the doors, it's easier to get closer to girls, and also to pass tests successfully. If you have that many points and you see something like "you should know about this" in the options, you will pass 90% door's.