Thanks for the tip Vidar :)
I have tested this a bit and thought I should share the results. As you said, the result does differ if you are logged into Edit at the same time. I also thought that there was a bug here because I'm always in edit when I test these things. I doubt that this will be a problem for customers since visitors don't have access to edit anyway. If you for some reason want to have the same result regardless of whether or not a user is logged into edit, you can use one of the following queries.
1) This will return only published/activated content, but because we are using SystemSession it will ignore read access and show content that the user doesn't have access to (like member-only content).
2) This will return the same as the query above, except for content the user doesn't have access to.
.Where(AqlHierarchicalContent.IsPublished == true
& AqlHierarchicalContent.ShowInMenu == true
& AqlHierarchicalContent.ReleaseDate < currentDate
& (AqlHierarchicalContent.RetainDate < new DateTime(1900,01,01) | AqlHierarchicalContent.RetainDate > currentDate))
As mentiond earlier, it shouldn't be necessary to do this extra work.