Are you sure about his YoB, as there is a record on Ancestry saying he enlisted January 1851 aged 22, and John enlisted the same day, aged 20
There are/were parishes in Cambridgeshire with the word 'Trinity' in them, such as Holy Trinity Ely & Holy Trinity Cambridge.
Possible baptisms at Holy Trinity Ely
25 Jul 1828 William s/o William & Elizabeth Brookes, Labourer otp
30 Mar 1832 John s/o William & Elizabeth Brooks, Labourer otp
The same couple baptised a son, Matthew in 1834, and in 1841 there is a John Brooks aged 10 Matthew Brooks 5 listed together in the Ely workhouse. If its the same family then I'm not sure where William is though.
ADDED: In 1851 Mat(t)hew is still in Ely but now living with his sister Emelia (Amelia) Levett aged 28, a widow and a pauper. Amelia was baptised 14 Jan 1822 & married Joseph Levett in 1839.