The Trek seems like a much better entry level bike not really a big Trek fan but looking at the specs and the bike overall it looks better : )
If you could swing it
https://www.specialized.com/us/en/ch...=291528-184105. SLX and nicer brakes than both and I think one of the nicer alloy frames in the industry.