Harry's trunk is magically enhanced to fit his broomstick
All Hogwarts school trunks come with extension charms
Hogwarts school trunks, like the majority of wizarding luggage, are issued with capacity enhancing or extension charms as standard. These spells not only increase the interior dimensions of objects, while leaving the outer ones unchanged, they also render the contents lighter.
Pottermore - Extension Charms
And we can see from the books that Harry keeps both his cauldron and broom inside his trunk at Privet Drive, something that would be hard to do without magic (unless he had a really big trunk.)
Harry took his face out of his hands, opened his eyes, and stared around his bedroom as though expecting to see something unusual there. As it happened, there were an extraordinary number of unusual things in this room. A large wooden trunk stood open at the foot of his bed, revealing a cauldron, broomstick, black robes, and assorted spellbooks. Rolls of parchment littered that part of his desk that was not taken up by the large, empty cage in which his snowy owl, Hedwig, usually perched. On the floor beside his bed a book lay open; Harry had been reading it before he fell asleep last night. The pictures in this book were all moving. Men in bright orange robes were zooming in and out of sight on broomsticks, throwing a red ball to one another.
Harry Potter and the Goblet of Fire - Chapter 2