There's quite a bit of history behind the terms but nowadays most people will see a trilby as a hat with a more stingy brim. Most hats I see that are categorized as a fedora usually has a 2" or larger brim, but like I said, that isn't really what defines the names.
That's the image I have, too - fedora wider brim and a little more graceful, maybe. Trilby a little more stiff looking (not literally). I think there are official definitions that a very good hatter might use, though.
I see some differences of opinion, here.... (as usual). I looked in a huge very old Webster's dictionary and did not find trilby even listed.
Roetzel seems to imply in his "gentleman" books that a trilby is more casual and yes - great for the races.
How about "fedora" generally an American term and "trilby" British? As we all know "fedora" comes from a character in an American play.
Adding to the above, a Trilby will be offered in a far wider range of materials than a fedora. A Trilby is a casual hat. No matter the hat, make certain it suits both you and your facial shape. Not every man looks good in a Trilby. They are better suited to smaller or slim men with wiry builds.