Why is «هَذَيْنِ» genitive in «مَرَرْتُ بِهَذَيْنِ»?

Demonstratives — forms, syntax and usage