The earlier you book the better, and the cheapest tickets we've found for trains from Birmingham to Huddersfield are $35.01.
Trains departing 30 days in advance will cost around $35 while booking 7 days in advance the price is around $38. Booking on the day of travel is likely to be more expensive, so it is worth booking in advance if you can to save money.